コード例 #1
0
def test_allowed_to_drive(capfd):
    allowed_driving('bob', 18)
    output = capfd.readouterr()[0].strip()
    assert output == 'bob is allowed to drive'

    allowed_driving('julian', 19)
    output = capfd.readouterr()[0].strip()
    assert output == 'julian is allowed to drive'
コード例 #2
0
def test_allowed_to_drive(capfd):
    allowed_driving("bob", 18)
    output = capfd.readouterr()[0].strip()
    assert output == "bob is allowed to drive"

    allowed_driving("julian", 19)
    output = capfd.readouterr()[0].strip()
    assert output == "julian is allowed to drive"
コード例 #3
0
ファイル: test_driving.py プロジェクト: boraxpr/bitesofpy
def test_allowed_to_drive_other_name(capfd):
    allowed_driving('julian', 19)
    output = capfd.readouterr()[0].strip()
    assert output == 'julian is allowed to drive'

    test_allowed_to_drive()
    test_allowed_to_drive_other_name()
    test_not_allowed_to_drive()
コード例 #4
0
ファイル: test_driving.py プロジェクト: willfrey/pybites
def test_not_allowed_to_drive(capfd):
    allowed_driving("tim", 17)
    output = capfd.readouterr()[0].strip()
    assert output == "tim is not allowed to drive"
コード例 #5
0
ファイル: test_driving.py プロジェクト: willfrey/pybites
def test_allowed_to_drive_other_name(capfd):
    allowed_driving("julian", 19)
    output = capfd.readouterr()[0].strip()
    assert output == "julian is allowed to drive"
コード例 #6
0
def test_not_allowed_to_drive(capfd):
    allowed_driving('tim', 16)
    output = capfd.readouterr()[0].strip()
    assert output == 'tim is not allowed to drive'