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))
def test_counts_lights_on(self): board = initialize_board(self.initial_state) self.assertEqual(count_lights_on(board), 15)
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('...##.'))