Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# Owners of code are automatically nominated to review PRs involving that code.

# These owners will be the default owners for everything in the repo.
* @tleonhardt

# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
# will be requested to review.
#*.js @octocat @github/js

# You can also use email addresses if you prefer.
#docs/* docs@example.com
20 changes: 20 additions & 0 deletions tests/test_cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,26 @@ def test_default_to_shell_unknown(shell_app):
out = run_cmd(shell_app, unknown_command)
assert out == ["*** Unknown syntax: {}".format(unknown_command)]

def test_default_to_shell_good(capsys):
app = cmd2.Cmd()
app.default_to_shell = True
line = 'ls'
statement = app.parser_manager.parsed(line)
retval = app._default(statement)
assert not retval
out, err = capsys.readouterr()
assert out == ''

def test_default_to_shell_failure(capsys):
app = cmd2.Cmd()
app.default_to_shell = True
line = 'ls does_not_exist.xyz'
statement = app.parser_manager.parsed(line)
retval = app._default(statement)
assert not retval
out, err = capsys.readouterr()
assert out == "*** Unknown syntax: {}\n".format(line)


def test_ansi_prompt_not_esacped(base_app):
prompt = '(Cmd) '
Expand Down