From 9e60c8dd2a3c8d27d02d1e7a019c55f23c6831c6 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Fri, 29 Mar 2024 00:55:14 +0200 Subject: textpage tests --- tests/test_enemies.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests/test_enemies.py') diff --git a/tests/test_enemies.py b/tests/test_enemies.py index 24c608c..aaf2b0c 100644 --- a/tests/test_enemies.py +++ b/tests/test_enemies.py @@ -1,8 +1,28 @@ +import os import unittest -from enemies.enemies import EnemySprite +from pathlib import Path + + +from enemies.enemies import EnemySprite, Enemies +from text import Fonts class TestEnemySprite(unittest.TestCase): def test_can_create(self): enemy = EnemySprite() self.assertNotEqual(None, enemy) + +class TestEnemies(unittest.TestCase): + def setUp(self): + Fonts.load_fonts(os.path.join( + Path(__file__).parent.parent.resolve(), + "src", + "sliceitoff")) + + def test_can_create(self): + enemies = Enemies() + self.assertNotEqual(None, enemies) + + def test_right_amount_of_enemies(self): + enemies = Enemies(count = 6) + self.assertEqual(6, len(enemies.sprites())) \ No newline at end of file -- cgit v1.2.3