def test_parse_input(self): self.assertEqual(result, parse_input(input1)) self.assertEqual('Input does not contain 2 lines', parse_input(input2)) self.assertEqual('Input does not contain 2 lines', parse_input(input3)) self.assertEqual(result, parse_input(input4)) self.assertEqual('Input does not contain 2 lines', parse_input(input5)) self.assertEqual(result, parse_input(input6)) self.assertEqual('length and array-length do not match', parse_input(input7)) self.assertEqual(result, parse_input(input8)) self.assertEqual('First value is no integer', parse_input(input9)) self.assertEqual('length and array-length do not match', parse_input(input10))
def test_state(self): f = solution.parse_input(examples[0]) self.assertEqual(0, solution.state(f, 0, 0)) self.assertEqual(0, solution.state(f, -1, 0)) self.assertEqual(0, solution.state(f, 0, -1)) self.assertEqual(0, solution.state(f, 6, 0)) self.assertEqual(0, solution.state(f, 0, 6)) self.assertEqual(1, solution.state(f, 0, 1))
def test_solution_02(): assert solution_02(parse_input()) == 2360
def test_solution_01(): assert solution_01(parse_input()) == 2592
def test_solve(starting_numbers, count, expected): assert solve(parse_input(starting_numbers), count) == expected
def test_step_4(self): self.assertListEqual(solution.parse_input(examples[4]), solution.step(solution.parse_input(examples[3])))
def test_parse(self): self.assertListEqual( [[0, 1, 0, 1, 0, 1], [0, 0, 0, 1, 1, 0], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 1, 1, 1, 0, 0]], solution.parse_input(examples[0]))