smoke: qa-wasp P3 + economy/headless runners
This commit is contained in:
parent
0b3d835963
commit
3046782474
5 changed files with 166 additions and 0 deletions
38
scripts/smoke/economy_smoke.py
Executable file
38
scripts/smoke/economy_smoke.py
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Short Pitch economy scenario — start 500, claim well, 10s seep, assert gain."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from game.sim.pitch_economy import Economy, SEEP_PER_SEC, START_PITCH
|
||||
|
||||
|
||||
def main() -> int:
|
||||
eco = Economy()
|
||||
assert eco.pitch == START_PITCH, f"start pitch want {START_PITCH} got {eco.pitch}"
|
||||
|
||||
well = eco.add_well()
|
||||
well.claim_via_refinery()
|
||||
assert well.claimed and well.has_refinery
|
||||
|
||||
before = eco.pitch
|
||||
eco.tick(10.0) # 10 simulated seconds of seep (GAMEPLAY.md +0.4/s)
|
||||
expected = before + SEEP_PER_SEC * 10.0
|
||||
if eco.pitch <= before:
|
||||
print(f"FAIL: pitch did not increase ({before} -> {eco.pitch})")
|
||||
return 1
|
||||
if abs(eco.pitch - expected) > 1e-9:
|
||||
print(f"FAIL: pitch {eco.pitch} != expected {expected}")
|
||||
return 1
|
||||
print(f"PASS: pitch {before} -> {eco.pitch} after 10s claimed seep")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue