예제 #1
0
def test_uncover_word_with_misses_and_guesses():
    word = _uncover_word('Python', '******', 'y')
    assert word == '*y****'

    word = _uncover_word('Python', '*y****', 'z')  # Miss!
    assert word == '*y****'

    word = _uncover_word('Python', '*y****', 'n')
    assert word == '*y***n'

    word = _uncover_word('Python', '*y***n', 'o')
    assert word == '*y**on'

    word = _uncover_word('Python', '*y**on', 'x')  # Miss!
    assert word == '*y**on'

    word = _uncover_word('Python', '*y**on', 'a')  # Miss!
    assert word == '*y**on'
예제 #2
0
def test_uncover_word_with_misses_and_guesses():
    word = _uncover_word('Python', '******', 'y')
    assert word == '*y****'

    word = _uncover_word('Python', '*y****', 'z')  # Miss!
    assert word == '*y****'

    word = _uncover_word('Python', '*y****', 'n')
    assert word == '*y***n'

    word = _uncover_word('Python', '*y***n', 'o')
    assert word == '*y**on'

    word = _uncover_word('Python', '*y**on', 'x')  # Miss!
    assert word == '*y**on'

    word = _uncover_word('Python', '*y**on', 'a')  # Miss!
    assert word == '*y**on'
예제 #3
0
def test_uncover_word_with_all_equal_characters():
    word = _uncover_word('aaa', '***', 'a')
    assert word == 'aaa'
예제 #4
0
def test_uncover_word_with_repeated_elements():
    word = _uncover_word('rmotr', '*****', 'r')
    assert word == 'r***r'
예제 #5
0
def test_uncover_word_with_miss_character():
    word = _uncover_word('Python', '******', 'z')
    assert word == '******'
예제 #6
0
def test_uncover_word_with_correct_character():
    word = _uncover_word('Python', '******', 'y')
    assert word == '*y****'
예제 #7
0
def test_uncover_word_with_invalid_masked_word():
    """Length of words is different"""
    with pytest.raises(InvalidWordException):
        _uncover_word('aaa', '**********', 'x')
예제 #8
0
def test_uncover_word_with_invalid_masked_word():
    """Length of words is different"""
    with pytest.raises(InvalidWordException):
        _uncover_word('aaa', '**********', 'x')
예제 #9
0
def test_uncover_word_is_case_insensitive_same_case():
    word = _uncover_word('Python', '******', 'P')
    assert word == 'p*****'
예제 #10
0
def test_uncover_word_is_case_insensitive_same_case():
    word = _uncover_word('Python', '******', 'P')
    assert word == 'p*****'
예제 #11
0
def test_uncover_word_with_empty_word():
    """Words are empty"""
    with pytest.raises(InvalidWordException):
        _uncover_word('', '', 'x')
예제 #12
0
def test_uncover_word_with_all_equal_characters():
    word = _uncover_word('aaa', '***', 'a')
    assert word == 'aaa'
예제 #13
0
def test_uncover_word_with_repeated_elements():
    word = _uncover_word('rmotr', '*****', 'r')
    assert word == 'r***r'
예제 #14
0
def test_uncover_word_with_miss_character():
    word = _uncover_word('Python', '******', 'z')
    assert word == '******'
예제 #15
0
def test_uncover_word_with_correct_character():
    word = _uncover_word('Python', '******', 'y')
    assert word == '*y****'
예제 #16
0
def test_uncover_word_is_case_insensitive_different_case():
    word = _uncover_word('Python', '******', 'p')
    assert word == 'p*****'
예제 #17
0
def test_uncover_word_with_empty_word():
    """Words are empty"""
    with pytest.raises(InvalidWordException):
        _uncover_word('', '', 'x')
예제 #18
0
def test_uncover_word_with_invalid_character():
    """Character to guess has len() > 1"""
    with pytest.raises(InvalidGuessedLetterException):
        _uncover_word('aaa', '***', 'xyz')
예제 #19
0
def test_uncover_word_is_case_insensitive_different_case():
    word = _uncover_word('Python', '******', 'p')
    assert word == 'p*****'
예제 #20
0
def test_uncover_word_with_invalid_character():
    """Character to guess has len() > 1"""
    with pytest.raises(InvalidGuessedLetterException):
        _uncover_word('aaa', '***', 'xyz')