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