Files
dcalc/backend/tests/unit/test_calc_service.py
T
2026-06-04 19:46:51 +08:00

23 lines
783 B
Python

import logging
from api.core.Auth import AlterState
from services.calc_service import calculate
def test_calculate_returns_character_calc_result(minimal_calc_config):
state = AlterState('GF.swordman_male.weapon_master', 'token', {}, '0', 0)
result = calculate(state, minimal_calc_config)
assert isinstance(result, dict)
assert set(['uuid', 'skills', 'info', 'suits', 'buffer']).issubset(result)
def test_calculate_logs_timing(caplog, minimal_calc_config):
state = AlterState('GF.swordman_male.weapon_master', 'token', {}, '0', 0)
with caplog.at_level(logging.INFO, logger='dcalc.calc'):
calculate(state, minimal_calc_config)
assert any('calc completed alter=GF.swordman_male.weapon_master' in record.message for record in caplog.records)