From 89929901e88749c8428afd0cf5684caa49a246b7 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Wed, 3 Dec 2025 17:45:22 +0100 Subject: Day 3 --- day3/test_init.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 day3/test_init.py (limited to 'day3/test_init.py') 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 @@ +# -*- coding: utf-8 -*- +import pytest + +from day3 import AssignmentOne, AssignmentTwo, Assignment + + +class TestAssignment: + data = [ + ["987654321111111", 2, 98], + ["811111111111119", 2, 89], + ["234234234234278", 2, 78], + ["818181911112111", 2, 92], + ["987654321111111", 12, 987654321111], + ["811111111111119", 12, 811111111119], + ["234234234234278", 12, 434234234278], + ["818181911112111", 12, 888911112111], + ] + + @pytest.mark.parametrize("battery,n,joltage", data) + def test_find_highest_joltage(self, battery: str, n: int, joltage: int): + banks = next(Assignment.parse_item(battery)) + assert Assignment.find_highest_joltage(banks, n) == joltage -- cgit v1.2.3