def test_part1(): ans = part1(text) print("Part 1 answer:", ans) assert ans == 7 # Real test assert part1() == 1451
def test_part1(): assert solution.part1(["#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2"]) == 4 assert solution.part1(["#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 3,3: 1x1"]) == 4 assert solution.part1(["#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 1,3: 1x2"]) == 6
def test_part1(): """Test part1 function""" input_instructions = [ ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X", 8, 11), ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X", 7, 101), ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X", 8, 0), ] assert part1(input_instructions) == 165
def test_examples(): examples = { '(())' : 0, '()()' : 0, '(((' : 3, '(()(()(' : 3, '))(((((' : 3, '())' : -1, '))(' : -1, ')))' : -3, ')())())' : -3 } for key in examples: assert s.part1(key) == examples[key]
def test_it(self): _, _, wanted = part1(self.input) self.assertEqual(wanted, self.output)
def test_it(self): guards, sleeptime, _ = part1(self.input) self.assertEqual(part2(guards, sleeptime), self.output)
def test_part1(): assert part1(example1) == 2
def test_part1(test_input=test_input): """Test part 1 function""" assert part1(test_input, window=5) == 127
def test_solve(): """Test with sample input.""" assert 4512 == solution.part1('input2')
def test_part1(rules=test_rules, msgs=test_msgs, expected=2): """Test part1 function""" assert part1(rules, msgs) == expected
def test_solution1(): assert solution.part1( ["abcdef", "bababc", "abbcde", "abcccd", "aabcdd", "abcdee", "ababab"]) == 12
def test_part1(): assert part1(ex) == 5
def test_part1(): test_result = 150 out = part1(test_input) print(out) assert (out == test_result)
def test_it(self): overlap, fabric = part1(self.input) self.assertEqual(part2(self.input, fabric), self.output)
def test_part1(): """Test part 1""" assert part1(directions=test_input, start_direction="E") == 25
def test_it(self): self.assertEqual(part1(self.input), self.output)
def test_part1(): """Test part1 function""" assert part1(earliest_time=939, bus_ids=["7", "13", "x", "x", "59", "x", "31", "19"]) == 295
def test_part1(): assert part1(case1) == 7 * 5 assert part1(case2) == 22 * 10
def test_part1(): assert part1(text) == 198
def test_part1(test_input): """Test part1 function""" assert part1(test_input[0], test_input[2]) == 71
def test_solution1(): assert solution.part1(test_input) == 10*24
def test_part1(input_adapters, expected): """Test part 1 function""" sorted_adapters = sorted(input_adapters) adapters = [0] + sorted_adapters + [sorted_adapters[-1] + 3] assert part1(adapters) == expected
def test_part1(): assert solution.part1([1, -1]) == 0