diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-04-17 17:10:07 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2018-04-17 08:31:48 +0000 |
commit | 098ee3cf6c742439cd48534d2a0ded6c2c1138fb (patch) | |
tree | 92be40cb69c3f83de50bdfb17aa6a014c0a471ff | |
parent | 4fc2da9ad0ac077db7b675db272d901d2249f66f (diff) | |
download | buildstream-tristan/fix-workspace-force-open.tar.gz |
tests/frontend/workspace.py: Added tests for force opening workspacestristan/fix-workspace-force-open
Guard against regressions of issue #364
-rw-r--r-- | tests/frontend/workspace.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 3d87c347f..6ecc9e2d2 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -104,6 +104,27 @@ def test_open_track(cli, tmpdir, datafiles, kind): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("kind", repo_kinds) +def test_open_force(cli, tmpdir, datafiles, kind): + element_name, project, workspace = open_workspace(cli, tmpdir, datafiles, kind, False) + + # Close the workspace + result = cli.run(project=project, args=[ + 'workspace', 'close', element_name + ]) + result.assert_success() + + # Assert the workspace dir still exists + assert os.path.exists(workspace) + + # Now open the workspace again with --force, this should happily succeed + result = cli.run(project=project, args=[ + 'workspace', 'open', '--force', element_name, workspace + ]) + result.assert_success() + + +@pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize("kind", repo_kinds) def test_close(cli, tmpdir, datafiles, kind): element_name, project, workspace = open_workspace(cli, tmpdir, datafiles, kind, False) |