diff options
| author | 2025-12-03 17:45:22 +0100 | |
|---|---|---|
| committer | 2025-12-03 17:45:22 +0100 | |
| commit | 89929901e88749c8428afd0cf5684caa49a246b7 (patch) | |
| tree | 655ecbc45c6d1691e9d6f4c1411dbfd18cb5312c /day3/test_init.py | |
| parent | 31a8d2b6b7da1fcf4992a1fa6190eb3c7dbc4000 (diff) | |
| download | 2025-89929901e88749c8428afd0cf5684caa49a246b7.tar.gz 2025-89929901e88749c8428afd0cf5684caa49a246b7.tar.bz2 2025-89929901e88749c8428afd0cf5684caa49a246b7.zip | |
Day 3
Diffstat (limited to 'day3/test_init.py')
| -rw-r--r-- | day3/test_init.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/day3/test_init.py b/day3/test_init.py new file mode 100644 index 0000000..ae4033e --- /dev/null +++ b/day3/test_init.py | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | import pytest | ||
| 3 | |||
| 4 | from day3 import AssignmentOne, AssignmentTwo, Assignment | ||
| 5 | |||
| 6 | |||
| 7 | class TestAssignment: | ||
| 8 | data = [ | ||
| 9 | ["987654321111111", 2, 98], | ||
| 10 | ["811111111111119", 2, 89], | ||
| 11 | ["234234234234278", 2, 78], | ||
| 12 | ["818181911112111", 2, 92], | ||
| 13 | ["987654321111111", 12, 987654321111], | ||
| 14 | ["811111111111119", 12, 811111111119], | ||
| 15 | ["234234234234278", 12, 434234234278], | ||
| 16 | ["818181911112111", 12, 888911112111], | ||
| 17 | ] | ||
| 18 | |||
| 19 | @pytest.mark.parametrize("battery,n,joltage", data) | ||
| 20 | def test_find_highest_joltage(self, battery: str, n: int, joltage: int): | ||
| 21 | banks = next(Assignment.parse_item(battery)) | ||
| 22 | assert Assignment.find_highest_joltage(banks, n) == joltage | ||
