summaryrefslogtreecommitdiff
path: root/tests/sources/previous_source_access.py
diff options
context:
space:
mode:
authorThomas Coldrick <thomas.coldrick@codethink.co.uk>2020-01-20 09:28:28 +0000
committerThomas Coldrick <thomas.coldrick@codethink.co.uk>2020-01-23 16:45:39 +0000
commit3ae24057522c458d78dcb006d02b90bb205444da (patch)
treee493e259f611b9c96f6e1b961650d921a6595cbd /tests/sources/previous_source_access.py
parent8aa7e8b6c2ca418aafddf4ce308a9d0ff56cf467 (diff)
downloadbuildstream-coldtom/testing-api.tar.gz
testing: Add functions to generate yaml filescoldtom/testing-api
Adds functions to the `buildstream.testing` package to allow plugins to dump elements and projects on the fly. Before this plugins were just accessing the private yaml API for tests and loading/dumping directly. I also allow access to just `_yaml.load()` from testing.
Diffstat (limited to 'tests/sources/previous_source_access.py')
-rw-r--r--tests/sources/previous_source_access.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sources/previous_source_access.py b/tests/sources/previous_source_access.py
index fadf6710c..3c95d77e2 100644
--- a/tests/sources/previous_source_access.py
+++ b/tests/sources/previous_source_access.py
@@ -4,7 +4,7 @@
import os
import pytest
-from buildstream import _yaml
+from buildstream.testing import generate_project, load_yaml
from buildstream.testing import cli # pylint: disable=unused-import
DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "previous_source_access")
@@ -20,10 +20,10 @@ def test_custom_transform_source(cli, datafiles):
# Set the project_dir alias in project.conf to the path to the tested project
project_config_path = os.path.join(project, "project.conf")
- project_config = _yaml.load(project_config_path)
+ project_config = load_yaml(project_config_path)
aliases = project_config.get_mapping("aliases")
aliases["project_dir"] = "file://{}".format(project)
- _yaml.roundtrip_dump(project_config, project_config_path)
+ generate_project(project, project_config)
# Ensure we can track
result = cli.run(project=project, args=["source", "track", "target.bst"])