Skip to content

Commit 122ff0c

Browse files
committed
Fixing unit tests
1 parent 8d882f5 commit 122ff0c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
398398
'timing': 'Report execution times'}
399399

400400
# Commands to exclude from the help menu and tab completion
401-
self.hidden_commands = ['eof', '_relative_run_script']
401+
self.hidden_commands = ['eof', '_relative_load', '_relative_run_script']
402402

403403
# Commands to exclude from the history command
404404
# initialize history

tests/conftest.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
# Help text for base cmd2.Cmd application
2929
BASE_HELP = """Documented commands (type help <topic>):
3030
========================================
31-
alias help load py quit shell
32-
edit history macro pyscript set shortcuts
31+
alias help load py quit run_script shell
32+
edit history macro pyscript run_pyscript set shortcuts
3333
""" # noqa: W291
3434

3535
BASE_HELP_VERBOSE = """
@@ -44,6 +44,8 @@
4444
py Invoke Python command or shell
4545
pyscript Run a Python script file inside the console
4646
quit Exit this application
47+
run_pyscript Run a Python script file inside the console
48+
run_script Run commands in script file that is encoded as either ASCII or UTF-8 text
4749
set Set a settable parameter or show current settings of parameters
4850
shell Execute a command as if at the OS prompt
4951
shortcuts List available shortcuts
@@ -89,8 +91,8 @@
8991
SHORTCUTS_TXT = """Shortcuts for other commands:
9092
!: shell
9193
?: help
92-
@: load
93-
@@: _relative_load
94+
@: run_script
95+
@@: _relative_run_script
9496
"""
9597

9698
# Output from the show command with default settings

tests/test_cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,8 +1934,8 @@ def test_onecmd_raw_str_quit(outsim_app):
19341934
def test_get_all_commands(base_app):
19351935
# Verify that the base app has the expected commands
19361936
commands = base_app.get_all_commands()
1937-
expected_commands = ['_relative_load', 'alias', 'edit', 'eof', 'help', 'history', 'load', 'macro',
1938-
'py', 'pyscript', 'quit', 'set', 'shell', 'shortcuts']
1937+
expected_commands = ['_relative_load', '_relative_run_script', 'alias', 'edit', 'eof', 'help', 'history', 'load',
1938+
'macro', 'py', 'pyscript', 'quit', 'run_pyscript', 'run_script', 'set', 'shell', 'shortcuts']
19391939
assert commands == expected_commands
19401940

19411941
def test_get_help_topics(base_app):

0 commit comments

Comments
 (0)