Skip to content

Commit c8cbfa6

Browse files
committed
chore(aoc): fix tests day 01/2023
1 parent ada3225 commit c8cbfa6

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
## Day 01/2023: Trebuchet?!
22

33
https://adventofcode.com/2023/day/1
4-
5-
Part One: `56397`
6-
7-
Part Two: `55701`
8-
9-
*Demo: `142` and `281`*
Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import os
2+
from dotenv import load_dotenv
23
from .solution_one_day_01_2023 import solve_day_01_2023_one
34
from .solution_two_day_01_2023 import solve_day_01_2023_two
45

6+
7+
load_dotenv()
8+
environment = os.getenv("ENVIRONMENT")
9+
510
filename_demo_one = "input_demo_one.txt"
611
filename_demo_two = "input_demo_two.txt"
712
filename = "input.txt"
@@ -11,16 +16,15 @@
1116
file_path = os.path.join(current_dir, filename)
1217

1318

14-
def test_day_01_2023_one():
15-
result_demo_one = solve_day_01_2023_one(file_path_demo_one)
16-
assert result_demo_one == 142
17-
result_one = solve_day_01_2023_one(file_path)
18-
assert result_one == 56397
19-
20-
21-
def test_second_part():
22-
result_demo_two = solve_day_01_2023_two(file_path_demo_two)
23-
assert result_demo_two == 281
24-
result_two = solve_day_01_2023_two(file_path)
25-
assert result_two == 55701
26-
19+
def test_day_01_2023():
20+
result_demo_1 = solve_day_01_2023_one(file_path_demo_one)
21+
assert result_demo_1 == 142
22+
result_demo_2 = solve_day_01_2023_two(file_path_demo_two)
23+
assert result_demo_2 == 281
24+
if environment == "development":
25+
expected_result_1 = int(os.getenv("SOLUTION_01_DAY_01_2023"))
26+
result_1 = solve_day_01_2023_one(file_path)
27+
assert expected_result_1 == result_1
28+
expected_result_2 = int(os.getenv("SOLUTION_02_DAY_01_2023"))
29+
result_2 = solve_day_01_2023_two(file_path)
30+
assert expected_result_2 == result_2

0 commit comments

Comments
 (0)