Skip to content

Commit

Permalink
[QA] Test cli() directly
Browse files Browse the repository at this point in the history
  • Loading branch information
JNRowe committed Jun 19, 2018
1 parent d672455 commit 17f0826
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_edist.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

from upoints.compat import PY2
from upoints.edist import (LocationsError, NumberedPoint, NumberedPoints,
main, read_csv)
cli, read_csv)


class TestLocationsError:
Expand Down Expand Up @@ -268,9 +268,10 @@ def test_read_csv():
assert names == ['01:My place', '02:Microsoft Research Cambridge']


def test_main(stdout):
def test_cli():
runner = CliRunner()
result = runner.invoke(main, ['--location', '52.015;-0.221', 'display'])
result = runner.invoke(cli, ['--location', '52.015;-0.221', '--verbose',
'display'])
if PY2:
assert result.output == \
"Location 1 is 52\xc2\xb000.90'N, 000\xc2\xb013.26'W\n"
Expand Down

0 comments on commit 17f0826

Please sign in to comment.