Пример #1
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
Пример #2
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