Example #1
0
 def test_canInsertWord(self):
     words =['this','one','will','do']
     directions = WSdirections()
     test = WSmatrix((11,11),directions.Right | directions.Left,words)
     for word in words:
         answer = test.canInsertWord(word, (0,0), directions.Right, test.matrix)
         assert answer == True
     assert test.canInsertWord('this is a very long word not to fit in grid', (0,0), directions.Right, test.matrix) == False
Example #2
0
 def test_canInsertWord(self):
     words = ['this', 'one', 'will', 'do']
     directions = WSdirections()
     test = WSmatrix((11, 11), directions.Right | directions.Left, words)
     for word in words:
         answer = test.canInsertWord(word, (0, 0), directions.Right,
                                     test.matrix)
         assert answer == True
     assert test.canInsertWord(
         'this is a very long word not to fit in grid', (0, 0),
         directions.Right, test.matrix) == False
Example #3
0
 def test_insertWord(self):
     words =['this','one','will','do','nicely', 'fine', 'thankyou','seriouslybroken']
     directions = WSdirections()
     test = WSmatrix((5,9),directions.Right | directions.Left,words)
     matrix = test.matrix
     assert test.canInsertWord(words[0], (0,0), directions.Right,matrix) == True
     
     test.debug = False
     assert test.canInsertWord(words[1:][0], (0,0), directions.Right,matrix) == True
     assert test.canInsertWord(words[1:][0], (1,0), directions.Right,matrix) == True
     assert test.canInsertWord(words[2], (2,0), directions.Right,matrix) == True
     assert test.canInsertWord(words[3], (3,0), directions.Right,matrix) == True
     assert test.canInsertWord(words[4], (4,0), directions.Right,matrix) == True
Example #4
0
    def test_insertWord(self):
        words = [
            'this', 'one', 'will', 'do', 'nicely', 'fine', 'thankyou',
            'seriouslybroken'
        ]
        directions = WSdirections()
        test = WSmatrix((5, 9), directions.Right | directions.Left, words)
        matrix = test.matrix
        assert test.canInsertWord(words[0], (0, 0), directions.Right,
                                  matrix) == True

        test.debug = False
        assert test.canInsertWord(words[1:][0], (0, 0), directions.Right,
                                  matrix) == True
        assert test.canInsertWord(words[1:][0], (1, 0), directions.Right,
                                  matrix) == True
        assert test.canInsertWord(words[2], (2, 0), directions.Right,
                                  matrix) == True
        assert test.canInsertWord(words[3], (3, 0), directions.Right,
                                  matrix) == True
        assert test.canInsertWord(words[4], (4, 0), directions.Right,
                                  matrix) == True