Skip to content

Commit

Permalink
Merge pull request #6 from lfyzjck/master
Browse files Browse the repository at this point in the history
update arg_parser.py to fix `--port` argument type
  • Loading branch information
swistakm committed Apr 23, 2015
2 parents 0f3d1e1 + d7abdf0 commit ca1f27d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ianitor/args_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def get_parser():

parser.add_argument(
"--port",
type=int,
help="set service port",
)

Expand Down
6 changes: 6 additions & 0 deletions tests/test_args_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def test_parse_args():
args, invocation = args_parser.parse_args()
assert invocation == ['tail', '-f', 'something']


@patch('sys.argv', ["ianitor", "tailf", '--port', '1234', '--', 'tail', '-f', 'something']) # noqa
def test_parse_port():
args, invocation = args_parser.parse_args()
assert args.port == 1234

TEST_TTL = 100


Expand Down

0 comments on commit ca1f27d

Please sign in to comment.