File: test_cli.py

package info (click to toggle)
python-textile 1%3A2.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 444 kB
  • ctags: 233
  • sloc: python: 2,320; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import six
import sys
import subprocess

def test_console_script():
    command = [sys.executable, '-m', 'textile', '../../../README.textile']
    try:
        result = subprocess.check_output(command)
    except AttributeError:
        command[2] = 'textile.__main__'
        result = subprocess.Popen(command,
                stdout=subprocess.PIPE).communicate()[0]
    with open('tests/fixtures/README.txt') as f:
        expect = ''.join(f.readlines())
    if type(result) == bytes:
        result = result.decode('utf-8')
    assert result == expect