diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_enemies.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/test_enemies.py b/tests/test_enemies.py index 315de88..ed114ae 100644 --- a/tests/test_enemies.py +++ b/tests/test_enemies.py @@ -1,19 +1,28 @@ import os import unittest +import pygame from pathlib import Path -from enemies.enemies import EnemySprite, Enemies +from enemies.enemies import EnemyBall, Enemies +from display import Scaling from text import Fonts -class TestEnemySprite(unittest.TestCase): +class TestEnemyBall(unittest.TestCase): + def setUp(self): + Fonts.load_fonts(os.path.join( + Path(__file__).parent.parent.resolve(), + "src", + "sliceitoff")) + def test_can_create(self): - enemy = EnemySprite() + enemy = EnemyBall() self.assertNotEqual(None, enemy) class TestEnemies(unittest.TestCase): def setUp(self): + Scaling.update_scaling((640,400)) Fonts.load_fonts(os.path.join( Path(__file__).parent.parent.resolve(), "src", @@ -30,4 +39,9 @@ class TestEnemies(unittest.TestCase): def test_update_notcrashing(self): enemies = Enemies(count = 6) for _ in range(10000): - enemies.update(dt=100) + enemies.update( + dt=100, + field_rects=[ + Scaling.active, + pygame.Rect(800,0,200,200) + ]) |