예제 #1
0
    def test_advances_board(self):
        board = initialize_board(self.initial_state)

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_1))

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_2))

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_3))

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_4))
예제 #2
0
    def test_advances_board(self):
        board = initialize_board(self.initial_state)

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_1))

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_2))

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_3))

        board = next_board(board)
        self.assertEqual(board, initialize_board(self.step_4))
예제 #3
0
 def test_counts_lights_on(self):
     board = initialize_board(self.initial_state)
     self.assertEqual(count_lights_on(board), 15)
예제 #4
0
 def test_initializes_board(self):
     board = initialize_board(self.initial_state)
     self.assertEqual(len(board), 6)
     self.assertEqual(len(board[0]), 6)
     self.assertEqual(board[0], list('.#.#.#'))
     self.assertEqual(board[1], list('...##.'))
예제 #5
0
 def test_counts_lights_on(self):
     board = initialize_board(self.initial_state)
     self.assertEqual(count_lights_on(board), 15)
예제 #6
0
 def test_initializes_board(self):
     board = initialize_board(self.initial_state)
     self.assertEqual(len(board), 6)
     self.assertEqual(len(board[0]), 6)
     self.assertEqual(board[0], list('.#.#.#'))
     self.assertEqual(board[1], list('...##.'))