summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-31 16:05:48 +0300
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-31 16:05:48 +0300
commit3471d122c45b6056ba20b46f7995c9f61affb954 (patch)
treef8cafb9ffadec70b2ab9e482f708d5290ee4d5cb
parentce4fe960180d1719b691d6e1895d240c5ab2087c (diff)
downloadbuildstream-3471d122c45b6056ba20b46f7995c9f61affb954.tar.gz
tests/loader/dependencies.py: Test errors when explicitly setting strict to Truetristan/bst-1/strict-rebuild
-rw-r--r--tests/loader/dependencies.py11
-rw-r--r--tests/loader/dependencies/elements/invalidnonstrict.bst10
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/loader/dependencies.py b/tests/loader/dependencies.py
index 1a8365259..e4b9c73ed 100644
--- a/tests/loader/dependencies.py
+++ b/tests/loader/dependencies.py
@@ -135,6 +135,17 @@ def test_invalid_strict_dependency(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
+def test_invalid_non_strict_dependency(cli, datafiles):
+ basedir = os.path.join(datafiles.dirname, datafiles.basename)
+ loader = make_loader(basedir)
+
+ with pytest.raises(LoadError) as exc:
+ element = loader.load(['elements/invalidnonstrict.bst'])[0]
+
+ assert (exc.value.reason == LoadErrorReason.INVALID_DATA)
+
+
+@pytest.mark.datafiles(DATA_DIR)
def test_build_dependency(datafiles):
basedir = os.path.join(datafiles.dirname, datafiles.basename)
loader = make_loader(basedir)
diff --git a/tests/loader/dependencies/elements/invalidnonstrict.bst b/tests/loader/dependencies/elements/invalidnonstrict.bst
new file mode 100644
index 000000000..3cb31a077
--- /dev/null
+++ b/tests/loader/dependencies/elements/invalidnonstrict.bst
@@ -0,0 +1,10 @@
+kind: manual
+description: |
+
+ This is an invalid non strict dependency because it is
+ currently illegal to explicitly set a dependency to be
+ non-strict (even though this is the default).
+
+depends:
+- filename: firstdep.bst
+ strict: false