summaryrefslogtreecommitdiff
path: root/tests/plugins
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-08-30 18:20:23 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-08-30 18:31:06 -0400
commit3cc01593a1bdfbcc12a128b258871b538c7c5a7f (patch)
treeff6d213e8a961842df04d46b0203da509d776f2c /tests/plugins
parentaa9222ca143e19b328bf12acb4a27045a877f281 (diff)
downloadbuildstream-3cc01593a1bdfbcc12a128b258871b538c7c5a7f.tar.gz
plugin tests: Added tests for new version assertions
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/basics.py22
-rw-r--r--tests/plugins/basics/badversionelement/__init__.py0
-rw-r--r--tests/plugins/basics/badversionelement/foo.py11
-rw-r--r--tests/plugins/basics/badversionsource/__init__.py0
-rw-r--r--tests/plugins/basics/badversionsource/foo.py11
5 files changed, 44 insertions, 0 deletions
diff --git a/tests/plugins/basics.py b/tests/plugins/basics.py
index b1506b64f..e12dfd14f 100644
--- a/tests/plugins/basics.py
+++ b/tests/plugins/basics.py
@@ -196,6 +196,28 @@ def test_element_bad_setup(plugin_fixture, datafiles):
foo_type = factory.lookup('foo')
+# Load a factory with a plugin which requires an absurdly
+# high version of buildstream
+@pytest.mark.datafiles(os.path.join(DATA_DIR, 'badversionsource'))
+def test_source_badversion(plugin_fixture, datafiles):
+ factory = SourceFactory(plugin_fixture['base'],
+ [os.path.join(datafiles.dirname,
+ datafiles.basename)])
+ with pytest.raises(PluginError) as exc:
+ foo_type = factory.lookup('foo')
+
+
+# Load a factory with a plugin which requires an absurdly
+# high version of buildstream
+@pytest.mark.datafiles(os.path.join(DATA_DIR, 'badversionelement'))
+def test_element_badversion(plugin_fixture, datafiles):
+ factory = ElementFactory(plugin_fixture['base'],
+ [os.path.join(datafiles.dirname,
+ datafiles.basename)])
+ with pytest.raises(PluginError) as exc:
+ foo_type = factory.lookup('foo')
+
+
##############################################################
# Check we can load different contexts of plugin #
##############################################################
diff --git a/tests/plugins/basics/badversionelement/__init__.py b/tests/plugins/basics/badversionelement/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/plugins/basics/badversionelement/__init__.py
diff --git a/tests/plugins/basics/badversionelement/foo.py b/tests/plugins/basics/badversionelement/foo.py
new file mode 100644
index 000000000..2a8b12abe
--- /dev/null
+++ b/tests/plugins/basics/badversionelement/foo.py
@@ -0,0 +1,11 @@
+from buildstream import Element
+
+
+class FooElement(Element):
+
+ # We have a little while until we have to manually modify this
+ BST_REQUIRED_VERSION_MAJOR = 5000
+
+
+def setup():
+ return FooElement
diff --git a/tests/plugins/basics/badversionsource/__init__.py b/tests/plugins/basics/badversionsource/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/plugins/basics/badversionsource/__init__.py
diff --git a/tests/plugins/basics/badversionsource/foo.py b/tests/plugins/basics/badversionsource/foo.py
new file mode 100644
index 000000000..23333a9d8
--- /dev/null
+++ b/tests/plugins/basics/badversionsource/foo.py
@@ -0,0 +1,11 @@
+from buildstream import Source
+
+
+class FooSource(Source):
+
+ # We have a little while until we have to manually modify this
+ BST_REQUIRED_VERSION_MAJOR = 5000
+
+
+def setup():
+ return FooSource