Skip to content

Commit 512c280

Browse files
author
farbfetzen
committed
Fix URLs in aoc.py
1 parent d1391ab commit 512c280

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

python/aoc.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
raise ValueError(f"Day {day} not in range [1, 25].")
2828

2929
year = str(year)
30-
day = f"{day:02}"
30+
day_with_zero = f"{day:02}"
3131
base_path = os.path.dirname(os.path.realpath(__file__))
3232
year_dir = os.path.join(base_path, year)
33-
input_filename = f"{year}-{day}-input.txt"
33+
input_filename = f"{year}-{day_with_zero}-input.txt"
3434
sample_filename = input_filename.replace("input.txt", "sample.txt")
3535
relative_input_path = os.path.join("..", "..", "input", input_filename)
3636
relative_sample_path = os.path.join("..", "..", "input", sample_filename)
3737
input_path = os.path.abspath(os.path.join(base_path, "..", "input", input_filename))
3838
sample_path = input_path.replace(input_filename, sample_filename)
39-
solution_path = os.path.join(year_dir, f"day{day}.py")
39+
solution_path = os.path.join(year_dir, f"day{day_with_zero}.py")
4040
test_path = os.path.join(year_dir, f"test{year}.py")
4141
config_path = os.path.abspath(os.path.join(base_path, "..", "config.json"))
4242

@@ -61,13 +61,13 @@ def part_1(foo):
6161
"""
6262

6363
test_template = f"""import unittest\n
64-
import day{day}\n\n
64+
import day{day_with_zero}\n\n
6565
class Test{year}(unittest.TestCase):\n
66-
def test_{day}(self):
67-
self.assertEqual(day{day}.part_1(day{day}.sample_data), 0)
68-
# self.assertEqual(day{day}.part_2(day{day}.sample_data), 0)\n
69-
self.assertEqual(day{day}.part_1(day{day}.challenge_data), 0)
70-
# self.assertEqual(day{day}.part_2(day{day}.challenge_data), 0)\n\n
66+
def test_{day_with_zero}(self):
67+
self.assertEqual(day{day_with_zero}.part_1(day{day_with_zero}.sample_data), 0)
68+
# self.assertEqual(day{day_with_zero}.part_2(day{day_with_zero}.sample_data), 0)\n
69+
self.assertEqual(day{day_with_zero}.part_1(day{day_with_zero}.challenge_data), 0)
70+
# self.assertEqual(day{day_with_zero}.part_2(day{day_with_zero}.challenge_data), 0)\n\n
7171
if __name__ == "__main__":
7272
unittest.main()
7373
"""

0 commit comments

Comments
 (0)