summaryrefslogtreecommitdiff
path: root/tests/test_enemies.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-30 12:07:49 +0200
committerViljami Ilola <+@hix.fi>2024-03-30 12:07:49 +0200
commit607c00bc57fb68572754404cb5da0e7f7a5618e5 (patch)
tree195f10e6506a1c30500662230c807dc2756431af /tests/test_enemies.py
parent51c495d9691d19b65b377d377599ce1d52def874 (diff)
refactor enemies to add bounchers
Diffstat (limited to 'tests/test_enemies.py')
-rw-r--r--tests/test_enemies.py22
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)
+ ])