Example #1
0
def test_part_two():
    graph = load_data("test_input.txt")
    for node_name, node in graph.nodes.items():
        print(node_name, node.out_edges)
    assert part_two(graph) == 32

    graph = load_data("test_input2.txt")
    for node_name, node in graph.nodes.items():
        print(node_name, node.out_edges)
    assert part_two(graph) == 126
Example #2
0
def test_part_two():
    tiles = [
        Tile(int(lines[0].split()[1][:-1]), lines[1:])
        for lines in load_data('test_input.txt')
    ]
    tiles = arrange_tiles(tiles)
    assert part_two(tiles) == 273
Example #3
0
def test_part_two():
    examples = {
        '1212' : 6,
        '1221' : 0,
        '123425' : 4,
        '123123' : 12,
        '12131415' : 4
    }
    for elem in examples:
        assert s.part_two(elem) == examples[elem]
def test_part_two():
    examples = {
        '<>': 0,
        '<random characters>': 17,
        '<<<<>': 3,
        '<{!>}>': 2,
        '<!!>': 0,
        '<!!!>>': 0,
        '<{o"i!a,<{i<a>': 10
    }
    for elem in examples:
        assert s.part_two(elem) == examples[elem]
def test_part_two():
    assert part_two(load_data("test_input.txt")) == 8
    assert part_two(load_data("test_input2.txt")) == 19208
Example #6
0
def test_part_two():
    assert part_two([14]) == 2
    assert part_two([1969]) == 966
    assert part_two([100756]) == 50346
    assert part_two([14, 1969, 100756]) == 51314
Example #7
0
def test_part_two():
    assert part_one("test_input2.txt") == 3
    assert part_two("test_input2.txt") == 12
def test_part_two():
    assert s.part_two([0, 3, 0, 1, -3]) == 10
def test_part_two():
    data = load_data("test_input.txt")
    assert part_two(data) == 286
def test_part_two():
    assert part_two("test_input.txt", preamble_length=5) == 62
def test_part_two():
    assert part_two(load_data("invalid_test.txt")) == 0
    assert part_two(load_data("valid_test.txt")) == 4
def test_part_two():
    data = load_data('test_input.txt')
    assert part_two(data) == "mxmxvkd,sqjhc,fvjkl"
def test_part_two():
    assert part_two(5764801, 17807724) is None
def test_part_two():
    assert s.part_two([(5, 9, 2, 8), (9, 4, 7, 3), (3, 8, 6, 5)]) == 9
Example #15
0
def test_part_two():
    assert part_two("389125467") == 149245887792
def test_part_two():
    assert part_two("test_input.txt") == 848
Example #17
0
def test_part_two():
    data = load_data('test_input.txt')
    assert part_two(data) == 291
Example #18
0
def test_part_two():
    assert part_two(load_directions("test_input.txt")) == 2208
def test_part_two():
    instructions = load_data("test_input2.txt")
    assert part_two(instructions) == 208
Example #20
0
def test_part_two():
    assert part_two(load_data('test_input.txt')[1]) == 1068781
def test_part_two():
    assert s.part_two(example) == 4
def test_part_two():
    assert part_two(load_data("testdata.txt")) == 336
def test_part_two():
    assert part_two([0, 3, 6]) == 175594