コード例 #1
0
def test_print_html(capsys):

    cruvis_io(['-l', '12.1', '47.3', '--no-browser'])
    captured = capsys.readouterr()
    assert 'File successfully generated at:' in captured.out

    cruvis_io(['-c', 'InnsBruck', '--no-browser'])
    captured = capsys.readouterr()
    assert 'File successfully generated at:' in captured.out

    cruvis_io(['-m', 'innsbruck', '7', '--no-browser'])
    captured = capsys.readouterr()
    assert 'File successfully generated at:' in captured.out
コード例 #2
0
ファイル: test_cli.py プロジェクト: Holmgren825/ClimVis
def test_help(capsys):

    # Check that with empty arguments we return the help
    cruvis_io([])
    captured = capsys.readouterr()
    assert 'Usage:' in captured.out
    print(captured.out)

    cruvis_io(['-h'])
    captured = capsys.readouterr()
    assert 'Usage:' in captured.out

    cruvis_io(['--help'])
    captured = capsys.readouterr()
    assert 'Usage:' in captured.out
コード例 #3
0
def test_error(capsys):

    cruvis_io(['-l', '12.1'])
    captured = capsys.readouterr()
    string = 'cruvis --loc needs lon and lat parameters!'
    assert string in captured.out

    cruvis_io(['-c'])
    captured = capsys.readouterr()
    string = 'cruvis --city needs a city name!'
    assert string in captured.out

    cruvis_io(['-m', 'xxx'])
    captured = capsys.readouterr()
    string = 'cruvis --meteo needs station and duration parameters'
    assert string in captured.out
コード例 #4
0
ファイル: test_cli.py プロジェクト: Holmgren825/ClimVis
def test_error(capsys):

    cruvis_io(['-l', '12.1'])
    captured = capsys.readouterr()
    assert 'cruvis --loc needs lon and lat parameters!' in captured.out
コード例 #5
0
ファイル: test_cli.py プロジェクト: Holmgren825/ClimVis
def test_version(capsys):

    cruvis_io(['-v'])
    captured = capsys.readouterr()
    assert climvis.__version__ in captured.out