diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-09-06 17:50:24 +0100 |
---|---|---|
committer | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-09-14 10:51:48 +0100 |
commit | f0cf37a3fb3a7c9c5a405c63df09363a33f49577 (patch) | |
tree | 27e454431c856a9398d2fccf7f5fad52f0136b6c /tests/loader/basics.py | |
parent | 06b4d3aeae88a30d922cd044feaf9f255946fe55 (diff) | |
download | buildstream-f0cf37a3fb3a7c9c5a405c63df09363a33f49577.tar.gz |
Add element node validations
Diffstat (limited to 'tests/loader/basics.py')
-rw-r--r-- | tests/loader/basics.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/loader/basics.py b/tests/loader/basics.py index 4830702df..ef2a2158a 100644 --- a/tests/loader/basics.py +++ b/tests/loader/basics.py @@ -72,3 +72,15 @@ def test_fail_fullpath_target(datafiles): loader = Loader(basedir, fullpath, None, None, None, []) assert (exc.value.reason == LoadErrorReason.INVALID_DATA) + + +@pytest.mark.datafiles(os.path.join(DATA_DIR, 'onefile')) +def test_invalid_key(datafiles): + + basedir = os.path.join(datafiles.dirname, datafiles.basename) + loader = Loader(basedir, 'elements/invalidkey.bst', None, None, None, []) + + with pytest.raises(LoadError) as exc: + element = loader.load() + + assert (exc.value.reason == LoadErrorReason.INVALID_DATA) |