def test_11(self): sample_data = day11.get_data(day11.SAMPLE_PATH) self.assertEqual(day11.part_1(sample_data), 37) self.assertEqual(day11.part_2(sample_data), 26) challenge_data = day11.get_data(day11.INPUT_PATH) self.assertEqual(day11.part_1(challenge_data), 2299) self.assertEqual(day11.part_2(challenge_data), 2047)
def input_data(): data = day11.get_data(day11.FNAME_TEST) data = list(data) return zip(data[:-1], data[1:])
def test_count(input_data): data = day11.get_data(day11.FNAME_TEST) plan = next(data) assert day11.process(plan) == 37
def test_do_round_level0(): data = day11.get_data(day11.FNAME_TEST) plan = next(data) assert day11.process(plan, crowd=4, level=0) == 26
def input_data2(): data = day11.get_data(day11.FNAME_TEST.with_name('test_input2.txt')) return next(data)
def test_check_diagonals3(): data = day11.get_data(day11.FNAME_TEST) next(data) plan = next(data) assert day11.check_diagonals(plan, 0, 0, len(plan), len(plan), level=0) == 1