def test_part1_example1(self): input_list = [ 'abcdef', 'bababc', 'abbcde', 'abcccd', 'aabcdd', 'abcdee', 'ababab' ] result = day02.part1(input_list) self.assertEqual(result, 12)
def test_part1_c(): opcode = [2, 3, 0, 3, 99] answer = [2, 3, 0, 6, 99] assert day02.part1(opcode) == answer
def test_part1(): assert day02.part1('input_day02.txt') == 3516593
def test_part1(puzzle_input, answer): assert part1(puzzle_input) == answer
def test_part1_sample(): assert part1(['1-3 a: abcde\n', '1-3 b: cdefg\n', '2-9 c: ccccccccc\n']) == 2
def test_mult(self): self.assertEqual(part1([2, 4, 4, 5, 99, 0]), [2, 4, 4, 5, 99, 9801])
def test_simple_add(self): self.assertEqual(part1([1, 0, 0, 0, 99]), [2, 0, 0, 0, 99])
def test_part1_a(): opcode = [1, 9, 10, 3, 2, 3, 11, 0, 99, 30, 40, 50] answer = [3500, 9, 10, 70, 2, 3, 11, 0, 99, 30, 40, 50] assert day02.part1(opcode) == answer
def test_part1(): assert part1("day02/day02.dat") == 8715
def test_day02_part1(): assert day02.part1(['1-3 a: abcde', '1-3 b: cdefg', '2-9 c: ccccccccc']) == 2
def test_2_1_examples(): examples = [] for (inp, out) in examples: assert out == day02.part1(inp)
def test_part_1(input_data): assert part1(input_data) == 2272262
def test_part1_sample_2(): assert part1(['1-3 b: cdefg']) == 0
def test_part1_sample_1(): assert part1(['1-3 a: abcde']) == 1
def test_part1_d(): opcode = [2, 4, 4, 5, 99, 0] answer = [2, 4, 4, 5, 99, 9801] assert day02.part1(opcode) == answer
def test_part1_e(): opcode = [1, 1, 1, 4, 99, 5, 6, 0, 99] answer = [30, 1, 1, 4, 2, 5, 6, 0, 99] assert day02.part1(opcode) == answer
def test_regressions(self): self.assertEqual(3058646, part1()) self.assertEqual(8976, part2())
def test_part1_b(): opcode = [1, 0, 0, 0, 99] answer = [2, 0, 0, 0, 99] assert day02.part1(opcode) == answer
def test_part1_input(self): result = day02.part1(aoc.read_input('day02.input')) self.assertEqual(result, 5478)
def test_simple_mult(self): self.assertEqual(part1([2, 3, 0, 3, 99]), [2, 3, 0, 6, 99])
def test_part1(): assert part1(TEST) == 150
def test_longer(self): self.assertEqual(part1([1, 1, 1, 4, 99, 5, 6, 0, 99]), [30, 1, 1, 4, 2, 5, 6, 0, 99])
def test_part1_sample_3(): assert part1(['2-9 c: ccccccccc']) == 1