Exemplo n.º 1
0
def test_valid_create_card():
    """
    Test if a card that should be created by create_card is created properly
    """
    card = create_card('9C')
    assert type(card) is Card
    assert card.suit == 'C'
    assert card.value == '9'
Exemplo n.º 2
0
def test_invalid_create_card_type():
    """
    Test if passing something other than a string raises a type error
    """
    with pytest.raises(TypeError):
        card = create_card((9, 'C'))
Exemplo n.º 3
0
def test_invalid_create_card_value():
    """
    Test if passing an invalid string raises a ValueError
    """
    with pytest.raises(ValueError):
        card = create_card('hjnmv')