def test_day07_part2(): day07.part2( '3,26,1001,26,-4,26,3,27,1002,27,2,27,1,27,26,27,4,27,1001,28,-1,28,1005,28,6,99,0,0,5' ) == 139629729 day07.part2( '3,52,1001,52,-5,52,3,53,1,52,56,54,1007,54,5,55,1005,55,26,1001,54,-5,54,1105,1,12,1,53,54,53,1008,54,0,55,1001,55,1,55,2,53,55,53,4,53,1001,56,-1,56,1005,56,6,99,0,0,0,0,10' ) == 18216
def test_part2_example1(self): input_list = [ "3,26,1001,26,-4,26,3,27,1002,27,2,27,1,27,26," "27,4,27,1001,28,-1,28,1005,28,6,99,0,0,5" ] result = day07.part2(input_list) self.assertEqual(139629729, result)
def test_part2_example2(self): input_list = [ "3,52,1001,52,-5,52,3,53,1,52,56,54,1007,54,5,55,1005,55,26,1001,54," "-5,54,1105,1,12,1,53,54,53,1008,54,0,55,1001,55,1,55,2,53,55,53,4," "53,1001,56,-1,56,1005,56,6,99,0,0,0,0,10" ] result = day07.part2(input_list) self.assertEqual(18216, result)
def test_part2_input(self): result = day07.part2(aoc.read_input('day07.input')) self.assertEqual(result, 1024)
def test_part2_sample2(sample2_data): assert part2(sample2_data) == 126
def test_part2_sample(sample_data): assert part2(sample_data) == 32
def test_part2(): assert part2("day07/day07.dat", num_workers=5) == 1226
def test_day07_part2_answer(): assert day07.part2(open('input07.txt').read()) == 54803
def test_day07_part2_2(): assert day07.part2(day07_example_2) == 126
def test_day07_part2_1(): assert day07.part2(day07_example) == 32
def test_7_2_examples(): examples = [] for (inp, out) in examples: assert out == day07.part2(inp)
def test_part2(puzzle_input, answer): assert part2(puzzle_input) == answer
def test_regressions(self): self.assertEqual(17790, part1()) self.assertEqual(19384820, part2())
def test_part2_input(self): result = day07.part2(aoc.read_input('day07.input')) self.assertEqual(1714298, result)
def test_part2_final_result(): with open("day07_input.txt") as f: original_tape = [int(x) for x in f.readline().split(",")] t = list_to_defaultdict(original_tape) assert part2(t) == 17519904
def test_part2_params(tape, result): t = list_to_defaultdict(tape) assert part2(t) == result