diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-11 17:35:09 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-16 18:35:21 -0500 |
commit | c7f69bcc2d772157cde3a932c0e93f09a329019f (patch) | |
tree | 9d038e4ca1d4eed626ac47c22162a5ba0facd4fd | |
parent | e825bdd3b0edea6a7b49eadbcae16bd199d839dc (diff) | |
download | buildstream-c7f69bcc2d772157cde3a932c0e93f09a329019f.tar.gz |
tests: Removing tests/plugins/third_party.py
This tests exactly the same thing that is tested in
tests/internals/pluginfactory.py (the new location
of tests/plugins/basics.py).
5 files changed, 0 insertions, 79 deletions
diff --git a/tests/plugins/third_party.py b/tests/plugins/third_party.py deleted file mode 100644 index b7791a2e4..000000000 --- a/tests/plugins/third_party.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import pytest - -from pluginbase import PluginBase -from buildstream._elementfactory import ElementFactory -from buildstream._sourcefactory import SourceFactory - -from tests.testutils.setuptools import entry_fixture - -DATA_DIR = os.path.join( - os.path.dirname(os.path.realpath(__file__)), - 'third_party' -) - - -# Simple fixture to create a PluginBase object that -# we use for loading plugins. -@pytest.fixture() -def plugin_fixture(): - return { - 'base': PluginBase(package='buildstream.plugins') - } - - -################################################################## -# Tests # -################################################################## -# Test that external element plugin loading works. -@pytest.mark.datafiles(os.path.join(DATA_DIR, 'third_party_element')) -def test_custom_pip_element(plugin_fixture, entry_fixture, datafiles): - origin_data = [{ - 'origin': 'local', - 'path': str(datafiles), - 'plugins': {'foop': 0} - }] - factory = ElementFactory(plugin_fixture['base'], - plugin_origins=origin_data) - assert(isinstance(factory, ElementFactory)) - - entry_fixture(datafiles, 'buildstream.plugins', 'third_party_element:foop') - - foo_type, _ = factory.lookup('foop') - assert(foo_type.__name__ == 'FooElement') - - -# Test that external source plugin loading works. -@pytest.mark.datafiles(os.path.join(DATA_DIR, 'third_party_source')) -def test_custom_pip_source(plugin_fixture, entry_fixture, datafiles): - origin_data = [{ - 'origin': 'local', - 'path': str(datafiles), - 'plugins': {'foop': 0} - }] - factory = SourceFactory(plugin_fixture['base'], - plugin_origins=origin_data) - assert(isinstance(factory, SourceFactory)) - - entry_fixture(datafiles, 'buildstream.plugins', 'third_party_source:foop') - - foo_type, _ = factory.lookup('foop') - assert(foo_type.__name__ == 'FooSource') diff --git a/tests/plugins/third_party/third_party_element/__init__.py b/tests/plugins/third_party/third_party_element/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/plugins/third_party/third_party_element/__init__.py +++ /dev/null diff --git a/tests/plugins/third_party/third_party_element/foop.py b/tests/plugins/third_party/third_party_element/foop.py deleted file mode 100644 index 260de8b27..000000000 --- a/tests/plugins/third_party/third_party_element/foop.py +++ /dev/null @@ -1,9 +0,0 @@ -from buildstream import Element - - -class FooElement(Element): - pass - - -def setup(): - return FooElement diff --git a/tests/plugins/third_party/third_party_source/__init__.py b/tests/plugins/third_party/third_party_source/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/plugins/third_party/third_party_source/__init__.py +++ /dev/null diff --git a/tests/plugins/third_party/third_party_source/foop.py b/tests/plugins/third_party/third_party_source/foop.py deleted file mode 100644 index de78a00ce..000000000 --- a/tests/plugins/third_party/third_party_source/foop.py +++ /dev/null @@ -1,9 +0,0 @@ -from buildstream import Source - - -class FooSource(Source): - pass - - -def setup(): - return FooSource |