From a2b2fde9b410cf48b7b47c1a127a196485b5bb66 Mon Sep 17 00:00:00 2001 From: Jonathan Maw <jonathan.maw@codethink.co.uk> Date: Thu, 25 Oct 2018 14:31:51 +0100 Subject: [PATCH] tests: Workspace tests check existence of .bstproject.yaml --- tests/frontend/workspace.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 51b7d60889..7f8c1fed3c 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -93,6 +93,13 @@ def open_workspace(cli, tmpdir, datafiles, kind, track, suffix='', workspace_dir result.assert_success() + # Assert that a .bstproject.yaml file has been created + # and contains the path to the project + bstproject_path = os.path.join(workspace_dir, '.bstproject.yaml') + assert os.path.exists(bstproject_path) + with open(bstproject_path) as f: + assert project_path in f.read() + # Assert that we are now buildable because the source is # now cached. assert cli.get_element_state(project_path, element_name) == 'buildable' @@ -148,6 +155,10 @@ def test_open_force(cli, tmpdir, datafiles, kind): # Assert the workspace dir still exists assert os.path.exists(workspace) + # Assert the bstproject doesn't exist + bstproject_path = os.path.join(workspace, '.bstproject.yaml') + assert not os.path.exists(bstproject_path) + # Now open the workspace again with --force, this should happily succeed result = cli.run(project=project, args=[ 'workspace', 'open', '--force', element_name, workspace -- GitLab