test_part1.py•769 B
import pkmon_core.server as s
import json
def test_pokemon_resource():
# نجيب بيانات بوكيمون (مثلاً بيكاتشو)
data = s.get_pokemon("pikachu")
parsed = json.loads(data)
# تأكد من وجود العناصر المطلوبة
assert "stats" in parsed, "Missing stats"
assert "types" in parsed, "Missing types"
assert "abilities" in parsed, "Missing abilities"
assert "moves" in parsed, "Missing moves"
assert "evolution_chain" in parsed, "Missing evolution chain"
print(" Resource test passed!")
print(json.dumps(parsed, indent=2)[:400]) # نطبع أول 400 حرف بس
# نخلي الملف يشتغل مباشرة من غير pytest
if __name__ == "__main__":
test_pokemon_resource()