diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/relative_multiple.txt | 1 | ||||
-rw-r--r-- | tests/script.txt | 1 | ||||
-rw-r--r-- | tests/scripts/one_down.txt | 1 | ||||
-rw-r--r-- | tests/test_cmd2.py | 9 |
4 files changed, 4 insertions, 8 deletions
diff --git a/tests/relative_multiple.txt b/tests/relative_multiple.txt new file mode 100644 index 00000000..bbd11739 --- /dev/null +++ b/tests/relative_multiple.txt @@ -0,0 +1 @@ +_relative_load scripts/one_down.txt diff --git a/tests/script.txt b/tests/script.txt index 1e18262a..4dfe9677 100644 --- a/tests/script.txt +++ b/tests/script.txt @@ -1,2 +1 @@ -help help history diff --git a/tests/scripts/one_down.txt b/tests/scripts/one_down.txt new file mode 100644 index 00000000..b87ff844 --- /dev/null +++ b/tests/scripts/one_down.txt @@ -0,0 +1 @@ +_relative_load ../script.txt diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index ba83e426..92fdaa14 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -283,18 +283,13 @@ load {} assert out == expected -def test_base_load_default_file(base_app, capsys): - # TODO: Make sure to remove the 'command.txt' file in case it exists - +def test_base_load_with_empty_args(base_app, capsys): # The way the load command works, we can't directly capture its stdout or stderr run_cmd(base_app, 'load') out, err = capsys.readouterr() # The default file 'command.txt' doesn't exist, so we should get an error message - expected = normalize("""ERROR: Problem accessing script from command.txt: -[Errno 2] No such file or directory: 'command.txt' -To enable full traceback, run the following command: 'set debug true' -""") + expected = normalize("""ERROR: load command requires a file path:\n""") assert normalize(str(err)) == expected |