summaryrefslogtreecommitdiff
path: root/tests/sources/pip.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/pip.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/pip.py')
-rw-r--r--tests/sources/pip.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/sources/pip.py b/tests/sources/pip.py
index 7020f19c2..cfe20438a 100644
--- a/tests/sources/pip.py
+++ b/tests/sources/pip.py
@@ -4,19 +4,13 @@
import os
import pytest
-from buildstream import _yaml
from buildstream.exceptions import ErrorDomain
from buildstream.plugins.sources.pip import _match_package_name
-from buildstream.testing import cli # pylint: disable=unused-import
+from buildstream.testing import cli, ErrorDomain, generate_project # pylint: disable=unused-import
DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "pip",)
-def generate_project(project_dir):
- project_file = os.path.join(project_dir, "project.conf")
- _yaml.roundtrip_dump({"name": "foo"}, project_file)
-
-
# Test that without ref, consistency is set appropriately.
@pytest.mark.datafiles(os.path.join(DATA_DIR, "no-ref"))
def test_no_ref(cli, datafiles):