Ejemplo n.º 1
0
def test_make_str_form_column():
    res_1 = a3.make_str_from_column(BOARD, 1)
    res_2 = a3.make_str_from_column(BOARD, 0)
    res_3 = a3.make_str_from_column(BOARD, 3)

    assert type(res_1) is str
    assert res_1 == "NS"
    assert res_2 == "AX"
    assert res_3 == "TB"
Ejemplo n.º 2
0
 def test_make_str_from_column_3(self):
     # given
     board = [['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']]
     column_index = 3
     # when
     string = a3.make_str_from_column(board, column_index)
     # then
     self.assertEqual(string, 'TB')
Ejemplo n.º 3
0
 def test_str_from_column(self):
     self.assertEqual(a3.make_str_from_column(self.board1, 1),'NS')
     self.assertEqual(a3.make_str_from_column(self.board2, 0),'RC')
     self.assertEqual(a3.make_str_from_column(self.board4, 2),'JGRASSP')
Ejemplo n.º 4
0
# print(lst[0][3])

# lst = ['A', 'N', 'T', 'T']
# print(lst[0])

# for i in range(len(lst)):
#   print(lst[i])

lst = [['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']]

print(range(len(lst)))
#    print(lst[i][1])

#print(lst[0][1] + lst[1][1])
# prin(lst[i][column_index])

print(a3.make_str_from_column([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']], 1))
print(a3.make_str_from_column([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']], 2))

print(
    a3.board_contains_word_in_row([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']],
                                  'SOB'))

print(
    a3.board_contains_word_in_column(
        [['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']], 'NO'))

print(
    a3.board_contains_word([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']],
                           'ANT'))
Ejemplo n.º 5
0
 def test_make_str_from_column_index_1(self):
     self.assertEquals('NS', a3.make_str_from_column([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']], 1))
Ejemplo n.º 6
0
 def test16_make_str_from_column(self):
     """should return correct word for non square board for last index"""
     self.assertEqual("ORKN", a3.make_str_from_column(self.asym_board, 7))
Ejemplo n.º 7
0
 def test15_make_str_from_column(self):
     """should return correct word for square board for last index"""
     self.assertEqual("IPADMACA", a3.make_str_from_column(self.sym_board, 7))
Ejemplo n.º 8
0
 def test14_make_str_from_column(self):
     """should return correct word for non square board with first index"""
     self.assertEqual("BOLT", a3.make_str_from_column(self.asym_board, 0))
Ejemplo n.º 9
0
 def test13_make_str_from_column(self):
     """should return correct word for square board with first index"""
     self.assertEqual("PYTHONKS", a3.make_str_from_column(self.sym_board, 0))