Exemple #1
0
 def test_make_board_five(self):
     self.assertEqual(
         [[(0, 0), (1, 0), (2, 0), (3, 0),
           (4, 0)], [(0, 1), (1, 1), (2, 1), (3, 1),
                     (4, 1)], [(0, 2), (1, 2), (2, 2), (3, 2), (4, 2)],
          [(0, 3), (1, 3), (2, 3), (3, 3),
           (4, 3)], [(0, 4), (1, 4), (2, 4), (3, 4), (4, 4)]],
         make_board(5, 5))
Exemple #2
0
 def test_make_board_one(self):
     self.assertEqual([[(0, 0)]], make_board(1, 1))
Exemple #3
0
 def test_make_board_zero(self):
     self.assertEqual([], make_board(0, 0))
 def test_display_board_1_1(self, mock_stdout):
     expected_output = 'c\n'
     display_board(make_board(1, 1), [0, 0])
     self.assertEqual(mock_stdout.getvalue(), expected_output)
 def test_display_board_0_0(self, mock_stdout):
     expected_output = ''
     display_board(make_board(0, 0), [0, 0])
     self.assertEqual(mock_stdout.getvalue(), expected_output)
 def test_display_board_2_3(self, mock_stdout):
     expected_output = 'c x x\nx x x\n'
     display_board(make_board(2, 3), [0, 0])
     self.assertEqual(mock_stdout.getvalue(), expected_output)
 def test_display_board_5_5_2_2(self, mock_stdout):
     expected_output = 'x x x x x\nx x x x x\nx x c x x\nx x x x x\nx x x x x\n'
     display_board(make_board(5, 5), [2, 2])
     self.assertEqual(mock_stdout.getvalue(), expected_output)