Skip to content

Commit c0c64bc

Browse files
committed
add trivial test for cli tool version argument
1 parent 60fac4f commit c0c64bc

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/test_cli.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import subprocess
33
import sys
44

5+
import textile
6+
57
def test_console_script():
68
command = [sys.executable, '-m', 'textile', 'README.textile']
79
try:
@@ -15,3 +17,13 @@ def test_console_script():
1517
if type(result) == bytes:
1618
result = result.decode('utf-8')
1719
assert result == expect
20+
21+
def test_version_string():
22+
command = [sys.executable, '-m', 'textile', '-v']
23+
try:
24+
result = subprocess.check_output(command)
25+
except AttributeError:
26+
command[2] = 'textile.__main__'
27+
result = subprocess.Popen(command,
28+
stdout=subprocess.PIPE).communicate()[0]
29+
assert result.strip() == textile.__version__

0 commit comments

Comments
 (0)