annotate ikweb/tools/functional_test.py @ 286:2ddd2bd21ef2

list spydata when check enemies
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 04 Dec 2008 21:54:00 +0800
parents 7747bbe5b68e
children
rev   line source
247
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
1 from lazy.www import c
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
2
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
3 def create_player():
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
4 datas = {'game_id':1,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
5 'army_score_main':10000,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
6 'building_score_main':1000,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
7 'building_score_secondary':100,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
8 'name':'tplayer',
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
9 'research_score_main':122,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
10 'research_score_secondary':122,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
11 'score':10000,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
12 'trader_score_secondary':1000000
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
13 }
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
14 c("http://localhost:8080/player/create").post(datas)
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
15
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
16 def edit_player():
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
17 datas = {'game_id':1,
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
18 'name':'tfplayer'
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
19 }
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
20 c("http://localhost:8080/player/edit").post(datas)
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
21
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
22 import sys
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
23
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
24 act = sys.argv[1]
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
25 modelname = sys.argv[2]
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
26
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
27 funcname = "%s_%s" % (act,modelname)
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
28 print 'test',funcname
7747bbe5b68e start to develope Information Exchange Center of Ikariam Game. (prototpye)
"Hisn Yi, Chen <ossug.hychen@gmail.com>"
parents:
diff changeset
29 eval(funcname)()