♻️REFACTOR: Mejoras en la viabilidad para desarrollo
This commit is contained in:
1 parent
5aba6c7b47
commit
fd0118d964
98 files changed
+5985
-3024
No files matched your search
@@ -1,8 +1,7 @@
|
||||
"""Static checks for the Android item test course (no Godot runtime needed).
|
||||
"""Pruebas estaticas del laboratorio de objetos, sin ejecutar Godot.
|
||||
|
||||
Run from the project root: python -m unittest discover -s tests -v
|
||||
These tests check references and test-course configuration, not gameplay.
|
||||
"""
|
||||
Ejecutar: python -m unittest discover -s tests -v
|
||||
Comprueban referencias y configuracion del recorrido, no la jugabilidad."""
|
||||
|
||||
from pathlib import Path
|
||||
import re
|
||||
@@ -20,7 +19,7 @@ class Level01ConfigurationTests(unittest.TestCase):
|
||||
cls.resources = dict(
|
||||
re.findall(r'\[ext_resource [^\n]*path="res://([^"]+)" id="([^"]+)"\]', cls.scene)
|
||||
)
|
||||
# Format is path -> id; invert to follow ExtResource("item_N").
|
||||
# El formato es ruta -> id; invertirlo para resolver ExtResource("item_N").
|
||||
cls.by_id = {resource_id: path for path, resource_id in cls.resources.items()}
|
||||
cls.stations = re.findall(
|
||||
r'\[node name="Station(\d{2})" parent="TestEnemies" instance=ExtResource\("(v\d+)"\)\]'
|
||||
@@ -50,9 +49,9 @@ class Level01ConfigurationTests(unittest.TestCase):
|
||||
xs = [float(station[2]) for station in self.stations]
|
||||
self.assertEqual(xs, sorted(xs))
|
||||
self.assertTrue(all(0 <= x <= 8500 for x in xs))
|
||||
self.assertIn("size = Vector2(8500, 40)", self.scene)
|
||||
self.assertIn("dimensions = Vector2(8500, 40)", self.scene)
|
||||
self.assertIn("position = Vector2(8180, 535)", self.scene)
|
||||
self.assertIn("camera.limit_right = LEVEL_WIDTH", (ROOT / "levels/level_01.gd").read_text())
|
||||
self.assertIn("camera_bounds = Rect2(0, 0, 8500, 2500)", self.scene)
|
||||
|
||||
def test_finish_and_death_areas_detect_player_layer(self):
|
||||
for area in ("FinishZone", "DeathZone"):
|
||||
@@ -74,8 +73,8 @@ class Level01ConfigurationTests(unittest.TestCase):
|
||||
self.assertTrue(len(root) > 20, svg.name)
|
||||
|
||||
def test_control_pickup_and_death_tracking_are_separate(self):
|
||||
# The independent control object distinguishes a rendering fault from
|
||||
# a death/drop fault without relying on running the Python test in Godot.
|
||||
# El objeto de control permite distinguir un fallo de dibujo de uno de
|
||||
# muerte/recompensa, sin pretender que esta prueba de Python ejecute Godot.
|
||||
self.assertIn('name="ControlPickup"', self.scene)
|
||||
self.assertIn('pickup_data = ExtResource("lab_control")', self.scene)
|
||||
self.assertTrue((ROOT / 'pickups/data/lab_control.tres').is_file())
|
||||
|
||||
Reference in new issue
Block a user