Esempio n. 1
0
def test_safe_region_size():
    space = day6.Space(test_input, test_labels)
    space.build_regions()
    assert space.safe_region_size(32) == 16
Esempio n. 2
0
def test_part2():
    with open('input.txt') as f:
        input_ = f.read()
    space = day6.Space(input_)
    space.build_regions()
    assert space.safe_region_size(10000) == 39149
Esempio n. 3
0
def test_part1():
    with open('input.txt') as f:
        input_ = f.read()
    space = day6.Space(input_)
    space.build_regions()
    assert space.safest_size() == 4771
Esempio n. 4
0
def test_2():
    space = day6.Space(test_input, test_labels)
    space.build_regions()
    assert space.safest_place() == 'E'
Esempio n. 5
0
def test_1():
    test_sizes = {'A': -1, 'B': -1, 'C': -1, 'D': 9, 'E': 17, 'F': -1}
    space = day6.Space(test_input, test_labels)
    space.build_regions()
    sizes = space.sizes()
    assert all([sizes[key] == test_sizes[key] for key in test_sizes.keys()])
Esempio n. 6
0
def test_render():
    space = day6.Space(test_input, test_labels)
    space.build_regions()
    calc_output = space.render()
    assert calc_output == test_ouput
Esempio n. 7
0
def test_prebuild():
    space = day6.Space(test_input, test_labels)
    assert space.render() == test_output_prebuild