diff options
Diffstat (limited to 'tests/examples/junctions.py')
-rw-r--r-- | tests/examples/junctions.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py index 49e2ebbff..d2a653884 100644 --- a/tests/examples/junctions.py +++ b/tests/examples/junctions.py @@ -11,42 +11,12 @@ DATA_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), '..', '..', 'doc', 'examples', 'junctions' ) -JUNCTION_IMPORT_PATH = os.path.join( - os.path.dirname(os.path.realpath(__file__)), '..', '..', 'doc', 'examples', 'autotools' -) - - -def ammend_juntion_path_paths(tmpdir): - # The junction element in the examples/junctions project uses a local source type. - # It's "path:" must specify a relative path from the project's root directory. - # For the hello-junction element to function during these tests, the copy of the junctions - # project made in the buildstream/tmp/directory, "path:" must be ammended to be the relative - # path to the autotools example from the temporary test directory. - junction_element = os.path.join(tmpdir, "elements", "hello-junction.bst") - junction_element_bst = "" - junction_relative_path = os.path.relpath(JUNCTION_IMPORT_PATH, tmpdir) - with open(junction_element, 'r') as f: - junction_element_bst = f.read() - ammended_element_bst = junction_element_bst.replace("../autotools", junction_relative_path) - with open(junction_element, 'w') as f: - f.write(ammended_element_bst) - - -# Check that the autotools project is where the junctions example expects and -# contains the hello.bst element. -@pytest.mark.datafiles(DATA_DIR) -def test_autotools_example_is_present(datafiles): - autotools_path = JUNCTION_IMPORT_PATH - assert os.path.exists(autotools_path) - assert os.path.exists(os.path.join(autotools_path, "elements", "hello.bst")) - # Test that the project builds successfully @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) - ammend_juntion_path_paths(str(tmpdir)) result = cli.run(project=project, args=['build', 'callHello.bst']) result.assert_success() @@ -57,7 +27,6 @@ def test_build(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) def test_shell_call_hello(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) - ammend_juntion_path_paths(str(tmpdir)) result = cli.run(project=project, args=['build', 'callHello.bst']) result.assert_success() @@ -73,7 +42,6 @@ def test_shell_call_hello(cli, tmpdir, datafiles): def test_open_cross_junction_workspace(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace_dir = os.path.join(str(tmpdir), "workspace_hello_junction") - ammend_juntion_path_paths(str(tmpdir)) result = cli.run(project=project, args=['workspace', 'open', 'hello-junction.bst:hello.bst', workspace_dir]) |