diff options
-rw-r--r-- | tests/frontend/__init__.py | 10 | ||||
-rw-r--r-- | tests/frontend/buildtrack.py | 7 | ||||
-rw-r--r-- | tests/frontend/track.py | 8 |
3 files changed, 13 insertions, 12 deletions
diff --git a/tests/frontend/__init__.py b/tests/frontend/__init__.py index e69de29bb..8cf7625a9 100644 --- a/tests/frontend/__init__.py +++ b/tests/frontend/__init__.py @@ -0,0 +1,10 @@ +import os +from buildstream import _yaml + + +# Shared function to configure the project.conf inline +# +def configure_project(path, config): + config['name'] = 'test' + config['element-path'] = 'elements' + _yaml.dump(config, os.path.join(path, 'project.conf')) diff --git a/tests/frontend/buildtrack.py b/tests/frontend/buildtrack.py index 64617b860..84d543e52 100644 --- a/tests/frontend/buildtrack.py +++ b/tests/frontend/buildtrack.py @@ -9,6 +9,7 @@ from tests.testutils import cli, create_repo from buildstream import _yaml from buildstream._exceptions import ErrorDomain +from . import configure_project # Project directory DATA_DIR = os.path.join( @@ -28,12 +29,6 @@ def create_element(repo, name, path, dependencies, ref=None): _yaml.dump(element, os.path.join(path, name)) -def configure_project(path, config): - config['name'] = 'test' - config['element-path'] = 'elements' - _yaml.dump(config, os.path.join(path, 'project.conf')) - - @pytest.mark.datafiles(os.path.join(DATA_DIR)) @pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')]) @pytest.mark.parametrize("exceptions,excepted", [ diff --git a/tests/frontend/track.py b/tests/frontend/track.py index 62514cdd7..1425183be 100644 --- a/tests/frontend/track.py +++ b/tests/frontend/track.py @@ -5,6 +5,8 @@ from tests.testutils import cli, create_repo, ALL_REPO_KINDS from buildstream._exceptions import ErrorDomain from buildstream import _yaml +from . import configure_project + # Project directory TOP_DIR = os.path.dirname(os.path.realpath(__file__)) DATA_DIR = os.path.join(TOP_DIR, 'project') @@ -23,12 +25,6 @@ def generate_element(repo, element_path, dep_name=None): _yaml.dump(element, element_path) -def configure_project(path, config): - config['name'] = 'test' - config['element-path'] = 'elements' - _yaml.dump(config, os.path.join(path, 'project.conf')) - - @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')]) @pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS]) |