Skip to content

Commit 770a568

Browse files
authored
Merge pull request #180 from python-cmd2/code_owners
Added a CODEOWNERS file to automatically nominate code reviewers for PRs
2 parents 88fe14c + d380c48 commit 770a568

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

CODEOWNERS

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
# Owners of code are automatically nominated to review PRs involving that code.
4+
5+
# These owners will be the default owners for everything in the repo.
6+
* @tleonhardt
7+
8+
# Order is important. The last matching pattern has the most precedence.
9+
# So if a pull request only touches javascript files, only these owners
10+
# will be requested to review.
11+
#*.js @octocat @github/js
12+
13+
# You can also use email addresses if you prefer.
14+

tests/test_cmd2.py

+20
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,26 @@ def test_default_to_shell_unknown(shell_app):
829829
out = run_cmd(shell_app, unknown_command)
830830
assert out == ["*** Unknown syntax: {}".format(unknown_command)]
831831

832+
def test_default_to_shell_good(capsys):
833+
app = cmd2.Cmd()
834+
app.default_to_shell = True
835+
line = 'ls'
836+
statement = app.parser_manager.parsed(line)
837+
retval = app._default(statement)
838+
assert not retval
839+
out, err = capsys.readouterr()
840+
assert out == ''
841+
842+
def test_default_to_shell_failure(capsys):
843+
app = cmd2.Cmd()
844+
app.default_to_shell = True
845+
line = 'ls does_not_exist.xyz'
846+
statement = app.parser_manager.parsed(line)
847+
retval = app._default(statement)
848+
assert not retval
849+
out, err = capsys.readouterr()
850+
assert out == "*** Unknown syntax: {}\n".format(line)
851+
832852

833853
def test_ansi_prompt_not_esacped(base_app):
834854
prompt = '(Cmd) '

0 commit comments

Comments
 (0)