-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import pytest | ||
|
||
@pytest.mark.parametrize("cmd,expected_in_response", [ | ||
(["script", "run", "hello.py"], ["hello world"]), | ||
(["script", "list"], ["hello.py"]), | ||
(["script", "show", "hello.py"], ["print('hello world')"]), | ||
(["env", "list"], ["python"]), | ||
(["env", "show", "python"], ["python"]), | ||
(["env", "create"], ["All conda environments created!"]), | ||
(["env", "create", "python"], ["Created environment python!"]), | ||
(["env", "run", "-v", "python", "which python"], [".snakemake"]), | ||
(["env", "activate", "python"], ["Activating python environment...", "Exiting python environment..."]), | ||
(["env", "remove", "-f"], ["Deleted"]), | ||
@pytest.mark.parametrize("cmd,expected_in_stdout,expected_in_stderr", [ | ||
(["script", "run", "hello.py"], ["hello world"], []), | ||
(["script", "list"], ["hello.py"], []), | ||
(["script", "show", "hello.py"], ["print('hello world')"], []), | ||
(["env", "list"], ["python"], []), | ||
(["env", "show", "python"], ["python"], []), | ||
(["env", "create"], ["All conda environments created!"], []), | ||
(["env", "create", "python"], ["Created environment python!"], []), | ||
(["env", "run", "-v", "python", "which python"], [".snakemake"], []), | ||
(["env", "activate", "python"], [], ["Activating python environment...", "Exiting python environment..."]), | ||
(["env", "remove", "-f"], ["Deleted"], []), | ||
]) | ||
def test_snk_cli_command(local_runner, cmd, expected_in_response): | ||
def test_snk_cli_command(local_runner, cmd, expected_in_stdout, expected_in_stderr): | ||
res = local_runner(cmd) | ||
assert res.code == 0, res.stderr | ||
for expected in expected_in_response: | ||
assert expected in res.stdout, res.stderr | ||
for expected in expected_in_stdout: | ||
assert expected in res.stdout, res.stderr | ||
for expected in expected_in_stderr: | ||
assert expected in res.stderr, res.stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters