diff options
author | Jürg Billeter <j@bitron.ch> | 2016-12-05 11:34:59 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2016-12-05 11:59:24 +0100 |
commit | 8ac89a8d0f026b0c9e37fc8936ecc8c1064aba36 (patch) | |
tree | 5a83ea341ae6e16925c4e50f51d1c38c9852d218 /tests/loader | |
parent | e0d84a8f227da3535ae89c15450d0818c1b9ab09 (diff) | |
download | buildstream-8ac89a8d0f026b0c9e37fc8936ecc8c1064aba36.tar.gz |
Add loader test for dependency dict without variant
Diffstat (limited to 'tests/loader')
-rw-r--r-- | tests/loader/dependencies.py | 15 | ||||
-rw-r--r-- | tests/loader/dependencies/elements/target-depdict.bst | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/loader/dependencies.py b/tests/loader/dependencies.py index 77748249f..e54f7bd42 100644 --- a/tests/loader/dependencies.py +++ b/tests/loader/dependencies.py @@ -72,6 +72,21 @@ def test_shared_dependency(datafiles): assert(shareddepdep is firstdep) @pytest.mark.datafiles(DATA_DIR) +def test_dependency_dict(datafiles): + + basedir = os.path.join(datafiles.dirname, datafiles.basename) + loader = Loader(basedir, 'elements/target-depdict.bst', None, None) + element = loader.load() + + assert(isinstance(element, MetaElement)) + assert(element.kind == 'pony') + + assert(len(element.dependencies) == 1) + firstdep = element.dependencies[0] + assert(isinstance(firstdep, MetaElement)) + assert(firstdep.kind == 'thefirstdep') + +@pytest.mark.datafiles(DATA_DIR) def test_invalid_dependency_declaration(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader(basedir, 'elements/invaliddep.bst', None, None) diff --git a/tests/loader/dependencies/elements/target-depdict.bst b/tests/loader/dependencies/elements/target-depdict.bst new file mode 100644 index 000000000..22bc87910 --- /dev/null +++ b/tests/loader/dependencies/elements/target-depdict.bst @@ -0,0 +1,4 @@ +kind: pony +description: This is the main target +depends: +- filename: elements/firstdep.bst |