diff options
author | Phillip Smyth <phillip.smyth@codethink.co.uk> | 2018-11-12 10:38:41 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-11-12 14:57:51 +0000 |
commit | 56a54161240cc843ee74e227a2af1f4be55a57f4 (patch) | |
tree | 7632354c442f8eef2516611b6f84d707d3794931 | |
parent | ae5ccd766cdf531ba46c62e9d2b22b2812b6a195 (diff) | |
download | buildstream-element-path_not_validated.tar.gz |
tests/frontend: Add test for invalid element-pathelement-path_not_validated
-rw-r--r-- | tests/frontend/invalid_element_path/project.conf | 4 | ||||
-rw-r--r-- | tests/frontend/show.py | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/frontend/invalid_element_path/project.conf b/tests/frontend/invalid_element_path/project.conf new file mode 100644 index 000000000..7b09276e1 --- /dev/null +++ b/tests/frontend/invalid_element_path/project.conf @@ -0,0 +1,4 @@ +# Project config for frontend build test +name: test + +elephant-path: elements diff --git a/tests/frontend/show.py b/tests/frontend/show.py index ac2e71407..d6e153e2b 100644 --- a/tests/frontend/show.py +++ b/tests/frontend/show.py @@ -36,6 +36,19 @@ def test_show(cli, datafiles, target, format, expected): .format(expected, result.output)) +@pytest.mark.datafiles(os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "invalid_element_path", +)) +def test_show_invalid_element_path(cli, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + result = cli.run(project=project, silent=True, args=[ + 'show', + "foo.bst"]) + + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA) + + @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("target,except_,expected", [ ('target.bst', 'import-bin.bst', ['import-dev.bst', 'compose-all.bst', 'target.bst']), |