44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
"""
|
|
Tests for game_controller initialization and state.
|
|
|
|
Covers: GameController creates Bot, DeathManager, HealthManager, GameRecovery.
|
|
Tests the wiring between components without needing a real D2R client.
|
|
"""
|
|
import pytest
|
|
from logger import Logger
|
|
|
|
|
|
class TestGameController:
|
|
def setup_method(self):
|
|
Logger.init()
|
|
Logger.remove_file_logger()
|
|
# Reset singletons
|
|
import config
|
|
if hasattr(config, '_instance'):
|
|
config._instance = None
|
|
from health_manager import HealthManager
|
|
HealthManager._instance = None
|
|
|
|
def test_gamecontroller_creates_components(self):
|
|
from game_controller import GameController
|
|
gc = GameController()
|
|
assert gc.game_stats is not None
|
|
assert gc.is_running is False
|
|
|
|
def test_gamecontroller_creates_death_manager(self):
|
|
from game_controller import GameController
|
|
gc = GameController()
|
|
gc.start()
|
|
assert gc.death_manager is not None
|
|
|
|
def test_gamecontroller_creates_health_manager(self):
|
|
from game_controller import GameController
|
|
gc = GameController()
|
|
gc.start()
|
|
assert gc.health_manager is not None
|
|
|
|
def test_gamecontroller_creates_game_recovery(self):
|
|
from game_controller import GameController
|
|
gc = GameController()
|
|
gc.start()
|
|
assert gc.game_recovery is not None |