Example #1
0
def test_validate_choice1():
    choices = [0, 1, '2', 3, 'four']
    for choice in choices:
        assert_equal(validate_choice(choice, choices), choice)
Example #2
0
def test_validate_choice2():
    choices = [0, 1, 2]
    bads = ['0', '1', '2']
    for choice in bads:
        with pytest.raises(ValueError):
            validate_choice(choice, choices)
Example #3
0
def test_validate_choice1():
    choices = [0, 1, '2', 3, 'four']
    for choice in choices:
        assert validate_choice(choice, choices) == choice
Example #4
0
def test_validate_choice1():
    choices = [0, 1, '2', 3, 'four']
    for choice in choices:
        assert_equal(validate_choice(choice, choices), choice)
Example #5
0
def test_validate_choice2():
    choices = [0, 1, 2]
    bads = ['0', '1', '2']
    for choice in bads:
        with pytest.raises(ValueError):
            validate_choice(choice, choices)
Example #6
0
def test_validate_choice1():
    choices = [0, 1, '2', 3, 'four']
    for choice in choices:
        assert validate_choice(choice, choices) == choice