diff options
-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 |