Exemplo n.º 1
0
def test_functions():
    assert is_word_guessed("road", ["r", "o", "a", "d"]) == True
    assert is_word_guessed("road", ["r", "o", "v", "d"]) == False
    assert get_guessed_word("d", "dog", ['_', 'o', 'g']) == ['d', 'o', 'g']
    assert get_guessed_word("e", "car", ['_', 'a', 'r']) == ['_', 'a', 'r']
    assert is_guess_in_word("t", "tailor") == True
    assert is_guess_in_word("r", "late") == False
Exemplo n.º 2
0
def test_is_word_guessed():

    assert is_word_guessed('baloney',
                           'baloney') == True, 'Error: should return true'

    assert is_word_guessed(
        'baloney', 'blanoey') == True, 'Error: same letters, different order'
Exemplo n.º 3
0
def test_is_word_guessed():

    # Tests if the words match each other

    assert is_word_guessed("hello", "hello") == True
    assert is_word_guessed("bod", "bot") == False
    assert is_word_guessed("wall", "wall") == True
    assert is_word_guessed("rob", "bol") == False
 def test_partial(self):
     """ >>> is_word_guessed('cat, ['a','t'])
         >>> False 
     """
     word = 'cat'
     arr = ['a', 't']
     self.assertFalse(is_word_guessed(word, arr), False)
 def test_empty(self):
     """ >>> is_word_guessed('bacon', [])
         >>> False 
     """
     word = 'bacon'
     arr = []
     self.assertFalse(is_word_guessed(word, arr), False)
 def test_arr_of_integers(self):
     """ >>> is_word_guessed('cat, ['1','79'])
         >>> False 
     """
     word = 'gary'
     arr = [1, 79]
     self.assertFalse(is_word_guessed(word, arr), False)
Exemplo n.º 7
0
def test_is_word_guessed():
    # Set up
    secret_word = 'cat'
    letters_guessed = ['c','a','t']

    #test
    assert is_word_guessed(
        secret_word, letters_guessed) == True, 'is_word_guessed function is not working as intended'
 def test_all_words(self):
     """ >>> is_word_guessed("happy", ['h','p','p','a','y'])
         >>> True 
     """
     word = 'happy'
     arr = ['h', 'p', 'p', 'a', 'y']
     self.assertTrue(
         is_word_guessed(word, arr), True
     )  # try all letters of and array containing all letters of the word
Exemplo n.º 9
0
 def test_is_word_guessed(self):
     """This test will run using the is_word_guessed function
         Args:
             letters_guessed(string)
             secret_word(string)         
        Returns:
         True if letters are in secret word
     """
     secret_word = ['pillow']
     letters_guessed = ['p', 'i', 'l', 'l', 'o', 'w']
     self.assertEqual(is_word_guessed(secret_word, letters_guessed), False)
Exemplo n.º 10
0
def test_is_word_guessed():
    assert is_word_guessed('waterfall', 'waterfall') == True
    assert is_word_guessed('waterfall', 'waterfal') == False
    assert is_word_guessed('waterfall', 'wtrfll') == False
Exemplo n.º 11
0
 def test_is_word_guessed(self):
     self.assertEqual(is_word_guessed("wood", ["w", "o", "o", "d"]), True)
     self.assertEqual(is_word_guessed("wood", ["e", "o", "o", "d"]), False)
Exemplo n.º 12
0
def test_is_word_guessed():
    assert is_word_guessed("read", "read") == True
    assert is_word_guessed("read", "reed") == False
Exemplo n.º 13
0
def test_is_word_guessed():
    assert spaceman.is_word_guessed('apple', 'apl') == False
    assert spaceman.is_word_guessed('banana', 'ban') == True
    assert spaceman.is_word_guessed('cat', 'c') == False
Exemplo n.º 14
0
def test_is_word_guessed():
    assert is_word_guessed("mississipi", ['m', 's', 'p', 'i']) is True
    assert is_word_guessed("precedes", ['p', 'r', 'e', 'c', 'd']) is False
Exemplo n.º 15
0
 def test_is_word_guessed_true(self):
     self.assertEqual(is_word_guessed("cat", "act"), True)
Exemplo n.º 16
0
 def test_is_word_not_guessed(self):
     self.assertEqual(is_word_guessed("cat", "tar"), False)
Exemplo n.º 17
0
def test_is_word_guessed():
    assert is_word_guessed(('breast'),['b','r','e','a','s','t']) is True
    assert is_word_guessed(('eggs'),['e','g','g','s']) is True
    assert is_word_guessed(('butter'),['b','u','t','t','e','r']) is True
Exemplo n.º 18
0
 def test_is_word_guessed(self):
     # true case #3
     assert is_word_guessed("new york", "califoniah") == False
Exemplo n.º 19
0
    def test_is_word_guessed(self):
        fake_word = "Chu"
        letters_guessed = ["a", "b", "c"]

        self.assertEqual(is_word_guessed(fake_word, letters_guessed), False)
Exemplo n.º 20
0
def test_is_word_guessed():
    assert is_word_guessed('panda', ['a', 'b', 's', 'r', 'p']) == False
    assert is_word_guessed('arch',
                           ['s', 'n', 'r', 'p', 'a', 'e', 'c', 'h']) == True
Exemplo n.º 21
0
 def test_is_word_guessed(self):
     assert is_word_guessed('dog', 'cat') is False
Exemplo n.º 22
0
    def tests_is_word_guessed(selfself):

        assert spaceman.is_word_guessed("a", {"a"}) == True
        assert spaceman.is_word_guessed("a", {"b"}) == False
Exemplo n.º 23
0
 def test_is_word_guessed_more_letters(self):
     self.assertEqual(is_word_guessed("cat", "track"), True)
Exemplo n.º 24
0
def test_is_word_guessed():
    assert is_word_guessed('apple', 'apple') == True
    assert is_word_guessed('muy', 'bien') == False
Exemplo n.º 25
0
 def test_is_word_guessed(self):
     assert is_word_guessed('yoma', 'yom') == False
Exemplo n.º 26
0
    def test_is_word_guessed(self):

        assert is_word_guessed('fish', 'fish') is True
        assert is_word_guessed('NO', 'Yes') is False
Exemplo n.º 27
0
 def test_is_word_guessed_no_letters(self):
     self.assertEqual(is_word_guessed("cat", ""), False)
Exemplo n.º 28
0
def test_word_guessed():
    secret_word = 'rat'
    assert is_word_guessed(secret_word, 'r') == True 
    assert is_word_guessed(secret_word, 'l') == False
Exemplo n.º 29
0
def test_is_word_guessed():
    assert is_word_guessed(
        'test', 'test') == True, 'is_word_guessed() Error: word == word'