Ejemplo n.º 1
0
def test_calculate_total_difficulty_none_valid():
    """Test the _calculate_total_difficulty when none of the
    characteristics are valid.
    """

    word = Word("ejemplo")
    word._length = None
    word._silent_letters = None
    word._shared_phonemes = None

    with pytest.raises(ValueError):
        word._calculate_total_difficulty()
Ejemplo n.º 2
0
def test_calculate_total_difficulty(
    difficulty_length,
    difficulty_silent,
    difficulty_shared_phonemes,
    total_difficulty_expected,
):
    """Test the _calculate_total_difficulty."""

    word = Word("ejemplo")
    word._length = difficulty_length
    word._silent_letters = difficulty_silent
    word._shared_phonemes = difficulty_shared_phonemes
    total_difficulty_observed = word._calculate_total_difficulty()

    assert total_difficulty_observed == total_difficulty_expected