Overhaul: Golden ring flight course and magic spell dueling mini-game with mobile gestures
This commit is contained in:
+19
-15
@@ -13,11 +13,16 @@ def test_endpoints():
|
||||
|
||||
res = client.get("/broom")
|
||||
assert res.status_code == 200
|
||||
assert "Der Besenflug" in res.text
|
||||
assert "Der Goldene Ring-Flug" in res.text
|
||||
|
||||
res = client.get("/chess")
|
||||
res = client.get("/duel")
|
||||
assert res.status_code == 200
|
||||
assert "McGonagalls Zauberschach" in res.text
|
||||
assert "Das Zauberspruch-Duell" in res.text
|
||||
|
||||
# Test /chess redirects to /duel
|
||||
res = client.get("/chess", follow_redirects=False)
|
||||
assert res.status_code in [301, 302]
|
||||
assert res.headers["location"] == "/duel"
|
||||
|
||||
res = client.get("/bottles")
|
||||
assert res.status_code == 200
|
||||
@@ -43,24 +48,23 @@ def test_endpoints():
|
||||
assert "snape_scroll" in item_ids
|
||||
|
||||
# Test House API
|
||||
res = client.post("/api/player/house", json={"house": "slytherin"})
|
||||
res = client.post("/api/player/house", json={"house": "ravenclaw"})
|
||||
assert res.status_code == 200
|
||||
assert res.json()["house"]["name"] == "Slytherin"
|
||||
assert res.json()["house"]["name"] == "Ravenclaw"
|
||||
|
||||
# Test API Broom complete (adds silver_key)
|
||||
res = client.post("/api/broom/complete", json={"score": 500, "time_taken": 25})
|
||||
# Test API Broom complete
|
||||
res = client.post("/api/broom/complete", json={"score": 850, "time_taken": 22})
|
||||
assert res.status_code == 200
|
||||
data = res.json()
|
||||
assert data["success"] is True
|
||||
assert "silver_key" in data["state"]["inventory"]
|
||||
|
||||
# Test API Chess complete (adds chess_knight)
|
||||
res = client.post("/api/chess/complete")
|
||||
# Test API Duel complete (adds duel_badge)
|
||||
res = client.post("/api/duel/complete")
|
||||
assert res.status_code == 200
|
||||
chess_data = res.json()
|
||||
assert chess_data["success"] is True
|
||||
assert chess_data["new_item"]["id"] == "chess_knight"
|
||||
assert "chess_knight" in chess_data["state"]["inventory"]
|
||||
duel_data = res.json()
|
||||
assert duel_data["success"] is True
|
||||
assert duel_data["new_item"]["id"] == "duel_badge"
|
||||
assert "duel_badge" in duel_data["state"]["inventory"]
|
||||
|
||||
# Test API Bottles drink: Ahead / Black fire (Bottle 3 - Dwarf, adds philosophers_stone)
|
||||
res = client.post("/api/bottles/drink", json={"bottle": 3, "gate": "ahead"})
|
||||
@@ -75,7 +79,7 @@ def test_endpoints():
|
||||
assert res.status_code == 200
|
||||
assert res.json()["success"] is True
|
||||
|
||||
print("ALL TESTS (INCLUDING CHESS & MOBILE FLIGHT) PASSED! ♟️🧹✨")
|
||||
print("ALL TESTS (RING FLIGHT & SPELL DUEL) PASSED! ⭕🪄✨")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_endpoints()
|
||||
|
||||
Reference in New Issue
Block a user