formatting and cosmetic updates to 2020.
This commit is contained in:
parent
84c4cf9991
commit
cd75e58f77
28 changed files with 320 additions and 287 deletions
|
|
@ -6,28 +6,24 @@ import day1 as aoc
|
|||
|
||||
PUZZLE_DIR = pathlib.Path(__file__).parent
|
||||
|
||||
#these test fixtures setup the test, mainly by reading the filename into a string in this simple case.
|
||||
|
||||
# these test fixtures setup the test, mainly by reading the filename into a string in this simple case.
|
||||
@pytest.fixture
|
||||
def example1():
|
||||
puzzle_input = (PUZZLE_DIR / "example1").read_text().strip()
|
||||
def example():
|
||||
puzzle_input = (PUZZLE_DIR / "example").read_text().strip()
|
||||
return aoc.parse(puzzle_input)
|
||||
|
||||
@pytest.fixture
|
||||
def example2():
|
||||
puzzle_input = (PUZZLE_DIR / "example2").read_text().strip()
|
||||
return aoc.parse(puzzle_input)
|
||||
|
||||
# @pytest.mark.skip(reason="Not implemented")
|
||||
def test_parse_example1(example1):
|
||||
def test_parse(example):
|
||||
"""Test that input is parsed properly"""
|
||||
assert example1 == [1721, 979, 366, 299, 675, 1456]
|
||||
assert example == [1721, 979, 366, 299, 675, 1456]
|
||||
|
||||
# @pytest.mark.skip(reason="Not implemented")
|
||||
def test_part1_example1(example1):
|
||||
|
||||
def test_part1(example):
|
||||
"""Test part 1 on example input"""
|
||||
assert aoc.part1(example1) == 514579
|
||||
assert aoc.part1(example) == 514579
|
||||
|
||||
# @pytest.mark.skip(reason="Not implemented")
|
||||
def test_part2_example2(example1):
|
||||
|
||||
def test_part2(example):
|
||||
"""Test part 2 on example input"""
|
||||
assert aoc.part2(example1) == 241861950
|
||||
assert aoc.part2(example) == 241861950
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue