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)