summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-06 16:50:02 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-06 17:36:42 +0900
commit50b694a3a5abaa134d30add8b75b62f7e833a648 (patch)
treeed60e226d3eacb17663018879fbb9492e66eef88
parent420114a02e31f5c0c437291af06209b8db1f7002 (diff)
downloadbuildstream-50b694a3a5abaa134d30add8b75b62f7e833a648.tar.gz
tests/project/plugins.py: Removed this old style test
This is sufficiently covered by other tests in tests/format/project.py
-rw-r--r--tests/project/__init__.py0
-rw-r--r--tests/project/data/plugins/custom.bst9
-rw-r--r--tests/project/data/plugins/elements/__init__.py0
-rw-r--r--tests/project/data/plugins/elements/custom.py19
-rw-r--r--tests/project/data/plugins/project.conf13
-rw-r--r--tests/project/data/plugins/sources/__init__.py0
-rw-r--r--tests/project/data/plugins/sources/custom.py31
-rw-r--r--tests/project/plugins.py47
8 files changed, 0 insertions, 119 deletions
diff --git a/tests/project/__init__.py b/tests/project/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/project/__init__.py
+++ /dev/null
diff --git a/tests/project/data/plugins/custom.bst b/tests/project/data/plugins/custom.bst
deleted file mode 100644
index 6a378347a..000000000
--- a/tests/project/data/plugins/custom.bst
+++ /dev/null
@@ -1,9 +0,0 @@
-kind: custom
-description: Some kinda custom element
-
-sources:
-- kind: custom
- configuration: pony
-
-config:
- configuration: pony
diff --git a/tests/project/data/plugins/elements/__init__.py b/tests/project/data/plugins/elements/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/project/data/plugins/elements/__init__.py
+++ /dev/null
diff --git a/tests/project/data/plugins/elements/custom.py b/tests/project/data/plugins/elements/custom.py
deleted file mode 100644
index c18c234a9..000000000
--- a/tests/project/data/plugins/elements/custom.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from buildstream import Element
-
-
-class CustomElement(Element):
-
- def configure(self, node):
- print("Element Data: {}".format(node))
- self.node_validate(node, ['configuration'])
- self.configuration = self.node_subst_member(node, "configuration", '')
-
- def preflight(self):
- pass
-
- def get_unique_key(self):
- return self.configuration
-
-
-def setup():
- return CustomElement
diff --git a/tests/project/data/plugins/project.conf b/tests/project/data/plugins/project.conf
deleted file mode 100644
index 7d4cbd1ee..000000000
--- a/tests/project/data/plugins/project.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Basic project configuration that provides some plugins
-#
-name: pony
-
-plugins:
-- origin: local
- path: elements
- elements:
- custom: 0
-- origin: local
- path: sources
- sources:
- custom: 0
diff --git a/tests/project/data/plugins/sources/__init__.py b/tests/project/data/plugins/sources/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/project/data/plugins/sources/__init__.py
+++ /dev/null
diff --git a/tests/project/data/plugins/sources/custom.py b/tests/project/data/plugins/sources/custom.py
deleted file mode 100644
index 54c372bac..000000000
--- a/tests/project/data/plugins/sources/custom.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from buildstream import Source, Consistency
-
-
-class CustomSource(Source):
-
- def configure(self, node):
- print("Source Data: {}".format(node))
- self.node_validate(node, ['configuration'] + Source.COMMON_CONFIG_KEYS)
- self.configuration = self.node_get_member(node, str, "configuration")
-
- def preflight(self):
- pass
-
- def get_unique_key(self):
- return self.configuration
-
- def get_consistency(self):
- return Consistency.INCONSISTENT
-
- def refresh(self, node):
- return False
-
- def fetch(self):
- pass
-
- def stage(self, directory):
- pass
-
-
-def setup():
- return CustomSource
diff --git a/tests/project/plugins.py b/tests/project/plugins.py
deleted file mode 100644
index 432983dc5..000000000
--- a/tests/project/plugins.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import os
-import pytest
-
-from buildstream._context import Context
-from buildstream._project import Project
-from buildstream._pipeline import Pipeline
-
-DATA_DIR = os.path.join(
- os.path.dirname(os.path.realpath(__file__)),
- 'data',
-)
-
-
-def create_pipeline(tmpdir, basedir, target):
- context = Context()
- project = Project(basedir, context)
- context.artifactdir = os.path.join(str(tmpdir), 'artifact')
-
- def dummy_handler(message, context):
- pass
-
- context.set_message_handler(dummy_handler)
-
- return Pipeline(context, project, [target], [])
-
-
-# We've already validated that the plugin system works in
-# other tests, here we just want to load a custom plugin
-# and see if some of our configuration ended up on it, and
-# also test that the project's configuration of plugin
-# paths is actually working.
-#
-@pytest.mark.datafiles(os.path.join(DATA_DIR, 'plugins'))
-def test_custom_element(datafiles, tmpdir):
-
- basedir = os.path.join(datafiles.dirname, datafiles.basename)
- pipeline = create_pipeline(tmpdir, basedir, 'custom.bst')
-
- element = pipeline.targets[0]
- assert(len(element._Element__sources) > 0)
- source = element._Element__sources[0]
-
- assert(element.get_kind() == "custom")
- assert(source.get_kind() == "custom")
-
- assert(element.configuration == "pony")
- assert(source.configuration == "pony")