tests: added edge case

This commit is contained in:
korzepadawid 2022-04-04 21:27:47 +02:00
parent f06ea9e5b0
commit 4caba91c7e

View File

@ -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