summaryrefslogtreecommitdiff
path: root/tests/sources/bzr.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/bzr.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/bzr.py')
-rw-r--r--tests/sources/bzr.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/sources/bzr.py b/tests/sources/bzr.py
index ca727c793..2dcacfef5 100644
--- a/tests/sources/bzr.py
+++ b/tests/sources/bzr.py
@@ -4,10 +4,9 @@
import os
import pytest
-from buildstream import _yaml
-
from buildstream.testing import cli # pylint: disable=unused-import
from buildstream.testing import create_repo
+from buildstream.testing import generate_element
from buildstream.testing._utils.site import HAVE_BZR
DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "bzr")
@@ -24,7 +23,7 @@ def test_fetch_checkout(cli, tmpdir, datafiles):
# Write out our test target
element = {"kind": "import", "sources": [repo.source_config(ref=ref)]}
- _yaml.roundtrip_dump(element, os.path.join(project, "target.bst"))
+ generate_element(project, "target.bst", element)
# Fetch, build, checkout
result = cli.run(project=project, args=["source", "fetch", "target.bst"])