예제 #1
0
def test__between_100_and_200(capsys):
    with mock.patch('builtins.input', lambda x: 199):
        execute_app()
        captured = capsys.readouterr()
        price = 15000
        assert "Your wedding will cost " + str(
            price) + " dollars\n" == captured.out
예제 #2
0
def test_t(capsys):
    with mock.patch('builtins.input', lambda x: 201):
        execute_app()
        captured = capsys.readouterr()
        price = 20000
        "Your wedding will cost " + str(price) + " dollars\n" == captured.out
예제 #3
0
def test_between(capsys):
    with mock.patch('builtins.input', lambda x: 100):
        execute_app()
        captured = capsys.readouterr()
        assert "Buy me some coffee you cheap!\n" == captured.out
예제 #4
0
def test_for_less(capsys):
    with mock.patch('builtins.input', lambda x: 50):
        execute_app()
        captured = capsys.readouterr()
        assert "You are a poor guy, go away!\n" == captured.out
예제 #5
0
def test_for_more(stdin, capsys):
    with mock.patch('builtins.input', lambda x: 101):
        execute_app()
        captured = capsys.readouterr()
        assert "Give me your money!\n" == captured.out