diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-29 16:22:43 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-05-03 13:30:13 +0900 |
commit | e13275bdd92aae182d7e93f5b916c4fc4fd280f8 (patch) | |
tree | c26663281b60901ddd26e7303b4dc90fe947e338 /tests/plugins/loading.py | |
parent | 9084ae13d1872a21ae1a3298f44e192e7cf7ca8a (diff) | |
download | buildstream-e13275bdd92aae182d7e93f5b916c4fc4fd280f8.tar.gz |
tests/plugins/loading.py: Migrate tests for found/not found plugins
This new test replaces the test in tests/format/project.py.
Diffstat (limited to 'tests/plugins/loading.py')
-rw-r--r-- | tests/plugins/loading.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/plugins/loading.py b/tests/plugins/loading.py index a368e9952..a54df776e 100644 --- a/tests/plugins/loading.py +++ b/tests/plugins/loading.py @@ -200,3 +200,33 @@ def test_incompatible_minor_version(cli, datafiles, plugin_type): result = cli.run(project=project, args=["show", "element.bst"]) result.assert_main_error(ErrorDomain.PLUGIN, "incompatible-minor-version") + + +@pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize("plugin_type", [("elements"), ("sources")]) +def test_plugin_not_found(cli, datafiles, plugin_type): + project = str(datafiles) + + setup_element(project, plugin_type, "notfound") + + result = cli.run(project=project, args=["show", "element.bst"]) + result.assert_main_error(ErrorDomain.PLUGIN, "plugin-not-found") + + +@pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize("plugin_type", [("elements"), ("sources")]) +def test_plugin_found(cli, datafiles, plugin_type): + project = str(datafiles) + + update_project( + project, + { + "plugins": [ + {"origin": "local", "path": os.path.join("plugins", plugin_type, "found"), plugin_type: ["found"],} + ] + }, + ) + setup_element(project, plugin_type, "found") + + result = cli.run(project=project, args=["show", "element.bst"]) + result.assert_success() |