summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-31 15:49:31 +0300
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-31 15:50:10 +0300
commitb082f9aad9b33c1dcbbc457a1ae1c0b7f31f6258 (patch)
treef56ec6ffa3e15cab543a032393f8095cfd3151aa
parent1d4561b89e0c22dbb72839d3762974fdf037b27b (diff)
downloadbuildstream-b082f9aad9b33c1dcbbc457a1ae1c0b7f31f6258.tar.gz
tests/loader/dependencies.py: Testing for error of invalid strict runtime deps
-rw-r--r--tests/loader/dependencies.py11
-rw-r--r--tests/loader/dependencies/elements/invalidstrict.bst9
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/loader/dependencies.py b/tests/loader/dependencies.py
index cb750fcb1..1a8365259 100644
--- a/tests/loader/dependencies.py
+++ b/tests/loader/dependencies.py
@@ -124,6 +124,17 @@ def test_invalid_dependency_type(datafiles):
@pytest.mark.datafiles(DATA_DIR)
+def test_invalid_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/invalidstrict.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/invalidstrict.bst b/tests/loader/dependencies/elements/invalidstrict.bst
new file mode 100644
index 000000000..8893b4aa9
--- /dev/null
+++ b/tests/loader/dependencies/elements/invalidstrict.bst
@@ -0,0 +1,9 @@
+kind: manual
+description: |
+
+ This is an invalid strict dependency because runtime
+ dependencies cannot be strict.
+
+runtime-depends:
+- filename: firstdep.bst
+ strict: true