コード例 #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
コード例 #2
0
ファイル: test_spaceman.py プロジェクト: aucoeur/spaceman
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'
コード例 #3
0
ファイル: testfile.py プロジェクト: kmurata798/spaceman
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
コード例 #4
0
 def test_partial(self):
     """ >>> is_word_guessed('cat, ['a','t'])
         >>> False 
     """
     word = 'cat'
     arr = ['a', 't']
     self.assertFalse(is_word_guessed(word, arr), False)
コード例 #5
0
 def test_empty(self):
     """ >>> is_word_guessed('bacon', [])
         >>> False 
     """
     word = 'bacon'
     arr = []
     self.assertFalse(is_word_guessed(word, arr), False)
コード例 #6
0
 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)
コード例 #7
0
ファイル: test_spaceman.py プロジェクト: MaxIsWell42/spaceman
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'
コード例 #8
0
 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
コード例 #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)
コード例 #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
コード例 #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)
コード例 #12
0
def test_is_word_guessed():
    assert is_word_guessed("read", "read") == True
    assert is_word_guessed("read", "reed") == False
コード例 #13
0
ファイル: test.py プロジェクト: sprajjwal/spaceman
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
コード例 #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
コード例 #15
0
 def test_is_word_guessed_true(self):
     self.assertEqual(is_word_guessed("cat", "act"), True)
コード例 #16
0
 def test_is_word_not_guessed(self):
     self.assertEqual(is_word_guessed("cat", "tar"), False)
コード例 #17
0
ファイル: test_spaceman.py プロジェクト: GSCrawley/Spaceman
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
コード例 #18
0
 def test_is_word_guessed(self):
     # true case #3
     assert is_word_guessed("new york", "califoniah") == False
コード例 #19
0
ファイル: test_spaceman.py プロジェクト: chudierp/spaceman
    def test_is_word_guessed(self):
        fake_word = "Chu"
        letters_guessed = ["a", "b", "c"]

        self.assertEqual(is_word_guessed(fake_word, letters_guessed), False)
コード例 #20
0
ファイル: test.py プロジェクト: chelseacastelli/spaceman
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
コード例 #21
0
ファイル: spacemantest.py プロジェクト: pharaohivan/Spaceman
 def test_is_word_guessed(self):
     assert is_word_guessed('dog', 'cat') is False
コード例 #22
0
    def tests_is_word_guessed(selfself):

        assert spaceman.is_word_guessed("a", {"a"}) == True
        assert spaceman.is_word_guessed("a", {"b"}) == False
コード例 #23
0
 def test_is_word_guessed_more_letters(self):
     self.assertEqual(is_word_guessed("cat", "track"), True)
コード例 #24
0
def test_is_word_guessed():
    assert is_word_guessed('apple', 'apple') == True
    assert is_word_guessed('muy', 'bien') == False
コード例 #25
0
ファイル: test_spaceman.py プロジェクト: SamirIngley/Spaceman
 def test_is_word_guessed(self):
     assert is_word_guessed('yoma', 'yom') == False
コード例 #26
0
ファイル: test_compliment.py プロジェクト: Rasenku/Spaceman
    def test_is_word_guessed(self):

        assert is_word_guessed('fish', 'fish') is True
        assert is_word_guessed('NO', 'Yes') is False
コード例 #27
0
 def test_is_word_guessed_no_letters(self):
     self.assertEqual(is_word_guessed("cat", ""), False)
コード例 #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
コード例 #29
0
ファイル: test.py プロジェクト: LukazDane/SpaceMan2
def test_is_word_guessed():
    assert is_word_guessed(
        'test', 'test') == True, 'is_word_guessed() Error: word == word'