Skip to content

Commit

Permalink
tests: exclude Windows of main CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Oct 26, 2021
1 parent 93de018 commit 6438f20
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,16 @@ def test_cli():
assert args.verbose is True
assert args.language == 'en'
assert os.system('courlan --help') == 0 # exit status
# dry runs (writes to /tmp/)
inputfile = os.path.join(RESOURCES_DIR, 'input.txt')
testargs = ['', '-i', inputfile, '-o', '/tmp/tralala.txt']
with patch.object(sys, 'argv', testargs):
cli.main()
testargs = ['', '-i', inputfile, '-o', '/tmp/tralala.txt', '--sample']
with patch.object(sys, 'argv', testargs):
cli.main()
# doesn't work the same on Windows
if os.name != 'nt':
# dry runs (writes to /tmp/)
inputfile = os.path.join(RESOURCES_DIR, 'input.txt')
testargs = ['', '-i', inputfile, '-o', '/tmp/tralala.txt']
with patch.object(sys, 'argv', testargs):
cli.main()
testargs = ['', '-i', inputfile, '-o', '/tmp/tralala.txt', '--sample']
with patch.object(sys, 'argv', testargs):
cli.main()


def test_sample():
Expand Down

0 comments on commit 6438f20

Please sign in to comment.