summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-01-17 17:05:54 +0000
committerJürg Billeter <j@bitron.ch>2018-02-12 16:48:24 +0000
commit779f369b3a62578db66c474c17b14532dbc25930 (patch)
tree5c22a79bafc76e28d868f29078cd886efc2cc2e8
parent73b6e1e5df904d2e4079b7ae89a00d3ee9ef1b5b (diff)
downloadbuildstream-779f369b3a62578db66c474c17b14532dbc25930.tar.gz
test: Add tests that bzr workspace initialization acts as expected
-rw-r--r--tests/frontend/workspace.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index 186582c93..a58598bf6 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -1,6 +1,7 @@
import os
import pytest
import shutil
+import subprocess
from tests.testutils import cli, create_repo, ALL_REPO_KINDS
from buildstream import _yaml
@@ -76,6 +77,24 @@ def test_open(cli, tmpdir, datafiles, kind):
@pytest.mark.datafiles(DATA_DIR)
+def test_open_bzr(cli, tmpdir, datafiles):
+ element_name, project, workspace = open_workspace(cli, tmpdir, datafiles, "bzr", False)
+
+ # Check that the .bzr dir exists
+ bzrdir = os.path.join(workspace, ".bzr")
+ assert(os.path.isdir(bzrdir))
+
+ # Check that the correct origin branch is set
+ element_config = _yaml.load(os.path.join(project, "elements", element_name))
+ source_config = element_config['sources'][0]
+ output = subprocess.check_output(["bzr", "info"], cwd=workspace)
+ stripped_url = source_config['url'].lstrip("file:///")
+ expected_output_str = ("checkout of branch: /{}/{}"
+ .format(stripped_url, source_config['track']))
+ assert(expected_output_str in str(output))
+
+
+@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("kind", repo_kinds)
def test_open_track(cli, tmpdir, datafiles, kind):
open_workspace(cli, tmpdir, datafiles, kind, True)