https://github.com/manubot/manubot.git
Raw File
Tip revision: 5e2eeebe6ad32853c0de051f7a8b2676d770ed59 authored by Daniel Himmelstein on 07 October 2018, 12:03:30 UTC
Prepare v0.2.0 release
Tip revision: 5e2eeeb
test_command.py
import subprocess

import manubot


def test_version():
    stdout = subprocess.check_output(
        ['manubot', '--version'],
        universal_newlines=True,
    )
    version_str = f'v{manubot.__version__}'
    assert version_str == stdout.rstrip()


def test_missing_subcommand():
    process = subprocess.run(
        ['manubot'],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        universal_newlines=True,
    )
    print(process.stderr)
    assert process.returncode == 2
    assert 'error: the following arguments are required: subcommand' in process.stderr
back to top