예제 #1
0
def test_should_process_check_iscalled_with_valid_version(capsys):
    result = main(["check", "1.1.1"])
    assert not result
    captured = capsys.readouterr()
    assert not captured.out
예제 #2
0
def test_should_process_raise_error(capsys):
    rc = main(["bump", "major", "1.2"])
    assert rc != 0
    captured = capsys.readouterr()
    assert captured.err.startswith("ERROR")
예제 #3
0
def test_should_raise_systemexit_when_bump_iscalled_with_empty_arguments():
    with pytest.raises(SystemExit):
        main(["bump"])
예제 #4
0
def test_should_process_print(capsys):
    rc = main(["bump", "major", "1.2.3"])
    assert rc == 0
    captured = capsys.readouterr()
    assert captured.out.rstrip() == "2.0.0"