From 4caba91c7e14e3e47f40cc38e50edb37f60d4415 Mon Sep 17 00:00:00 2001 From: korzepadawid Date: Mon, 4 Apr 2022 21:27:47 +0200 Subject: [PATCH] tests: added edge case --- logic/__tests__/knights_queue_test.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/logic/__tests__/knights_queue_test.py b/logic/__tests__/knights_queue_test.py index 782be15..99ba7da 100644 --- a/logic/__tests__/knights_queue_test.py +++ b/logic/__tests__/knights_queue_test.py @@ -5,6 +5,20 @@ from models.knight import Knight class KnightsQueueTest(unittest.TestCase): + + def test_should_raise_when_knight_died_and_whole_team_dead(self): + with self.assertRaises(Exception): + knight1 = Knight(None) + knight1.health = 222 + knight2 = Knight(None) + knight2.health = 1 + + knights_queue = KnightsQueue([knight1], [knight2]) + knights_queue.dequeue_knight() + knights_queue.dequeue_knight() + knight2.health = -2 + knights_queue.dequeue_knight() + def test_should_make_valid_next_turn(self): knight1 = Knight(None) knight1.health = 222