diff options
author | Abderrahim Kitouni <akitouni@gnome.org> | 2020-02-17 15:11:06 +0100 |
---|---|---|
committer | Abderrahim Kitouni <akitouni@gnome.org> | 2020-02-17 18:39:50 +0100 |
commit | fb91adcc4e05aabf9055b7c2a4e706dd7da91ed7 (patch) | |
tree | 5642369c8963d6b16ce94c6dadb2e6da33b14a26 /tests | |
parent | f126f0afcd4df803d4a13a0f54b26afd1b173dd9 (diff) | |
download | buildstream-fb91adcc4e05aabf9055b7c2a4e706dd7da91ed7.tar.gz |
_project.py: fix the case where a simple string is passed to host-filesabderrahim/simple-host-files
also add a test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/shell.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/integration/shell.py b/tests/integration/shell.py index c4725ec07..cd93923b7 100644 --- a/tests/integration/shell.py +++ b/tests/integration/shell.py @@ -159,7 +159,7 @@ def test_no_shell(cli, datafiles): # Test that bind mounts defined in project.conf work -@pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) +@pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt"), (None)]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox") @pytest.mark.xfail( @@ -169,9 +169,12 @@ def test_no_shell(cli, datafiles): def test_host_files(cli, datafiles, path): project = str(datafiles) ponyfile = os.path.join(project, "files", "shell-mount", "pony.txt") - result = execute_shell( - cli, project, ["cat", path], config={"shell": {"host-files": [{"host_path": ponyfile, "path": path}]}} - ) + if path is None: + result = execute_shell(cli, project, ["cat", ponyfile], config={"shell": {"host-files": [ponyfile]}}) + else: + result = execute_shell( + cli, project, ["cat", path], config={"shell": {"host-files": [{"host_path": ponyfile, "path": path}]}} + ) assert result.exit_code == 0 assert result.output == "pony\n" |