def test_fit_char_horizontal_char_already_there(self): self.assertTrue( xword.fit_char_horizontal(0, 5, 't'), 'this letter is already in the puzzle at that location')
def test_fit_char_horizontal_space_taken(self): result = xword.fit_char_horizontal(6, 5, 'e') result = result or not isinstance(result, bool) self.assertFalse( result, 'there is already a different letter at that location')
def test_fit_char_horizontal_char_above(self): result = xword.fit_char_horizontal(3, 6, 's') result = result or not isinstance(result, bool) self.assertFalse(result, 'cant fit in this character here, s above it')
def test_fit_char_horizontal_works(self): self.assertTrue(xword.fit_char_horizontal(6, 6, 'r'), "should be able to fit in the puzzle")
.format(type(result)) # Type check crossword.char_above result = crossword.char_above(0, 0) assert isinstance(result, str), \ '''char_above should return an str, but returned {0}''' \ .format(type(result)) # Type check crossword.char_below result = crossword.char_below(0, 0) assert isinstance(result, str), \ '''char_below should return an str, but returned {0}''' \ .format(type(result)) # Type check crossword.fit_char_horizontal result = crossword.fit_char_horizontal(0, 0, "s") assert isinstance(result, bool), \ '''fit_char_horizontal should return an bool, but returned {0}''' \ .format(type(result)) # Type check crossword.fit_char_vertical result = crossword.fit_char_vertical(0, 0, "t") assert isinstance(result, bool), \ '''fit_char_vertical should return an bool, but returned {0}''' \ .format(type(result)) # Type check crossword.put_word(word, row, col, direction) result = crossword.put_word("p", 0, 0, "V") assert isinstance(result, type(None)), \ '''put_word should return a NoneType, but returned {0}''' \ .format(type(result))