from src.stats.combat_stats import CombatStats class VisibleAll: def test(self, _name): return True def test_self_healing_counts_while_in_combat(): stats = CombatStats(VisibleAll()) stats.on_player_appeared(0, 'Healer') stats.on_enter_combat(0) stats.on_health_received(0, 0, 100.0) combat_healing = stats.players_healing() total_healing = stats.players_total_healing() assert combat_healing[0].name == 'Healer' assert combat_healing[0].value == 100.0 assert total_healing[0].value == 100.0 def test_total_healing_includes_post_combat_healing(): stats = CombatStats(VisibleAll()) stats.on_player_appeared(0, 'Healer') stats.on_enter_combat(0) stats.on_health_received(0, 0, 100.0) stats.on_leave_combat(0) stats.on_health_received(0, 0, 50.0) combat_healing = stats.players_healing() total_healing = stats.players_total_healing() assert combat_healing[0].value == 100.0 assert total_healing[0].value == 150.0