Пример #1
0
def test_part2():
    ans = part2(text)
    print("Part 2 answer:", ans)
    assert ans == 5

    # Real test
    assert part2() == 1395
Пример #2
0
def test_part2():
    assert part2(example2) == 4
Пример #3
0
def test_part2():
    assert part2(text) == 230
Пример #4
0
def test_part2(input_adapters, expected):
    """Test part 2 function"""
    sorted_adapters = sorted(input_adapters)
    adapters = [0] + sorted_adapters + [sorted_adapters[-1] + 3]
    assert part2(adapters) == expected
Пример #5
0
def test_part2():
    test_result = 900
    out = part2(test_input)
    print(out)
    assert (out == test_result)
Пример #6
0
def test_part2():
    """Test part 2"""
    assert (
        part2(directions=test_input, waypoint={"N": 1, "E": 10, "S": 0, "W": 0}) == 286
    )
Пример #7
0
def test_part2():
    """Test part2 function"""
    assert (part2(mask_sequences=[
        ("000000000000000000000000000000X1001X", 42, 100),
        ("00000000000000000000000000000000X0XX", 26, 1),
    ]) == 208)
Пример #8
0
def test_part2():
    assert part2(case1) == 8
    assert part2(case2) == 19208
Пример #9
0
def test_part2(bus_ids: List[str], expected: int):
    """Test part2 function"""
    assert part2(bus_ids) == expected
Пример #10
0
def test_part2():
    part2(ex) == 8
Пример #11
0
def test_solve():
    """Test with sample input."""
    assert 12==solution.part2('input2')
Пример #12
0
def test_solution2():
    assert solution.part2(test_input) == 99*45
Пример #13
0
def test_part2():
    assert solution.part2(
        ["abcde", "fghij", "klmno", "pqrst", "fguij", "axcye",
         "wvxyz"]) == "fgij"
Пример #14
0
def test_part2(test_input=test_input):
    """Test part 2 function"""
    assert part2(test_input, target=127) == 62
Пример #15
0
 def test_it(self):
     self.assertEqual(part2(self.input), self.output)
Пример #16
0
 def test_it(self):
     guards, sleeptime, _ = part1(self.input)
     self.assertEqual(part2(guards, sleeptime), self.output)
Пример #17
0
def test_solve2():
    """Test with sample input."""
    assert 26984457539==solution.part2('input2',days=256)
Пример #18
0
 def test_it(self):
     overlap, fabric = part1(self.input)
     self.assertEqual(part2(self.input, fabric), self.output)
Пример #19
0
def test_part2():
    assert solution.part2([1, -1]) == 0
    assert solution.part2([7, 7, -2, -7, -4]) == 14