summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py44
1 files changed, 29 insertions, 15 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index ce47ef47..7d60110e 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -142,48 +142,62 @@ shortcuts
""")
assert out == expected
-
-def test_base_list(base_app):
+def test_history_with_string_argument(base_app):
run_cmd(base_app, 'help')
run_cmd(base_app, 'shortcuts')
- out = run_cmd(base_app, 'list')
+ run_cmd(base_app, 'help history')
+ out = run_cmd(base_app, 'history help')
expected = normalize("""
--------------------------[2]
-shortcuts
+-------------------------[1]
+help
+-------------------------[3]
+help history
""")
assert out == expected
-def test_list_with_string_argument(base_app):
+def test_history_with_integer_argument(base_app):
run_cmd(base_app, 'help')
run_cmd(base_app, 'shortcuts')
- run_cmd(base_app, 'help list')
- out = run_cmd(base_app, 'list help')
+ out = run_cmd(base_app, 'history 1')
expected = normalize("""
-------------------------[1]
help
--------------------------[3]
-help list
""")
assert out == expected
-def test_list_with_integer_argument(base_app):
+def test_history_with_integer_span(base_app):
run_cmd(base_app, 'help')
run_cmd(base_app, 'shortcuts')
- out = run_cmd(base_app, 'list 1')
+ run_cmd(base_app, 'help history')
+ out = run_cmd(base_app, 'history 1..2')
expected = normalize("""
-------------------------[1]
help
+-------------------------[2]
+shortcuts
""")
assert out == expected
+def test_history_with_span_start(base_app):
+ run_cmd(base_app, 'help')
+ run_cmd(base_app, 'shortcuts')
+ run_cmd(base_app, 'help history')
+ out = run_cmd(base_app, 'history 2:')
+ expected = normalize("""
+-------------------------[2]
+shortcuts
+-------------------------[3]
+help history
+""")
+ assert out == expected
-def test_list_with_integer_span(base_app):
+def test_history_with_span_end(base_app):
run_cmd(base_app, 'help')
run_cmd(base_app, 'shortcuts')
- run_cmd(base_app, 'help list')
- out = run_cmd(base_app, 'list 1..2')
+ run_cmd(base_app, 'help history')
+ out = run_cmd(base_app, 'history :2')
expected = normalize("""
-------------------------[1]
help