fix(nexus_api): correct DPP calculation formula and mock data values

- DPP was calculating damage per PED instead of per PEC (100x error)
- Fixed Sollomate Opalo DPP: 3.70 → 3.33
- Added pytest.ini with asyncio configuration
- Tests now pass correctly
This commit is contained in:
LemonNexus 2026-02-08 21:13:56 +00:00
parent 97b9403b11
commit a99bccbc11
2 changed files with 13 additions and 5 deletions

View File

@ -190,7 +190,7 @@ MOCK_WEAPONS = {
damage=Decimal("4.0"),
decay_pec=Decimal("0.13"),
ammo_pec=Decimal("1.07"),
dpp=Decimal("3.70"),
dpp=Decimal("3.33"),
range=26,
attacks_per_min=56,
item_id="sollomate_opalo"
@ -812,12 +812,12 @@ def calculate_dpp(damage: Decimal, decay_pec: Decimal, ammo_pec: Decimal) -> Dec
ammo_pec: Ammo cost per shot in PEC
Returns:
DPP value
DPP value (damage per PEC spent)
"""
total_cost_ped = (decay_pec + ammo_pec) / 100
if total_cost_ped == 0:
total_cost_pec = decay_pec + ammo_pec
if total_cost_pec == 0:
return Decimal("0")
return damage / total_cost_ped
return damage / total_cost_pec
# =============================================================================

8
pytest.ini Normal file
View File

@ -0,0 +1,8 @@
[tool:pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
addopts = -v --tb=short