summaryrefslogtreecommitdiff
path: root/tests/plugins/loading.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2020-04-29 16:22:43 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2020-05-03 13:30:13 +0900
commite13275bdd92aae182d7e93f5b916c4fc4fd280f8 (patch)
treec26663281b60901ddd26e7303b4dc90fe947e338 /tests/plugins/loading.py
parent9084ae13d1872a21ae1a3298f44e192e7cf7ca8a (diff)
downloadbuildstream-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.py30
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()