From 79fb9cc7eebfd3d1c1ce121d7c8d7289f3ffdfc4 Mon Sep 17 00:00:00 2001 From: alexo Date: Sat, 23 Dec 2023 13:27:52 +1100 Subject: [PATCH] test: day02 --- day02/tests/test_day2.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/day02/tests/test_day2.py b/day02/tests/test_day2.py index f65babc..fbc69a0 100644 --- a/day02/tests/test_day2.py +++ b/day02/tests/test_day2.py @@ -1,4 +1,4 @@ -from day02.day2 import INPUT_SMALL, Game, game_filter, get_games, part1, part2 +from day02.day2 import INPUT_SMALL, Draw, Game, game_filter, get_games, part1, part2 def get_game1() -> Game: @@ -9,8 +9,17 @@ def get_game2() -> Game: return Game("Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue") +def test_draw() -> None: + """Test draws""" + draw1: Draw = Draw("3 blue, 4 red") + draw2: Draw = Draw("4 blue, 3 green") + + assert [draw1.red, draw1.green, draw1.blue] == [4, 0, 3] + assert [draw2.red, draw2.green, draw2.blue] == [0, 3, 4] + + def test_game() -> None: - # constructor: + """Test games""" game1: Game = get_game1() game2: Game = get_game2()