mirror of
https://github.com/arnaucube/gogame.git
synced 2026-02-06 19:16:40 +01:00
add UpgradeBuilding functionallity
This commit is contained in:
32
test/test.py
32
test/test.py
@@ -41,11 +41,41 @@ t.rStatus("get /resources", r)
|
||||
jsonR = r.json()
|
||||
print(jsonR)
|
||||
|
||||
time.sleep(4)
|
||||
time.sleep(1)
|
||||
r = requests.get(URL + "/resources/"+ userid)
|
||||
t.rStatus("get /resources", r)
|
||||
jsonR = r.json()
|
||||
print(jsonR)
|
||||
|
||||
r = requests.get(URL + "/resources/"+ userid)
|
||||
t.rStatus("get /resources", r)
|
||||
jsonR = r.json()
|
||||
print(jsonR)
|
||||
|
||||
r = requests.get(URL + "/planets/"+userid)
|
||||
t.rStatus("post /planets/:userid", r)
|
||||
jsonR = r.json()
|
||||
print(jsonR)
|
||||
print(jsonR["planets"][0])
|
||||
planetid = jsonR["planets"][0]["id"]
|
||||
|
||||
d = {
|
||||
"planetid": planetid,
|
||||
"building": "metalplant",
|
||||
}
|
||||
r = requests.post(URL + "/buildings/"+userid, json=d)
|
||||
t.rStatus("post /building/:userid", r)
|
||||
jsonR = r.json()
|
||||
print(jsonR)
|
||||
|
||||
d = {
|
||||
"planetid": planetid,
|
||||
"building": "ressearchlab",
|
||||
}
|
||||
r = requests.post(URL + "/buildings/"+userid, json=d)
|
||||
t.rStatus("post /building/:userid", r)
|
||||
jsonR = r.json()
|
||||
print(jsonR)
|
||||
|
||||
t.printScores()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user