Mercurial > eagle-eye
comparison ikweb/tools/functional_test.py @ 280:b5897d63f44e
work merged
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Tue, 02 Dec 2008 17:20:56 +0800 |
parents | 7747bbe5b68e |
children |
comparison
equal
deleted
inserted
replaced
277:cea21f99e56f | 280:b5897d63f44e |
---|---|
1 from lazy.www import c | |
2 | |
3 def create_player(): | |
4 datas = {'game_id':1, | |
5 'army_score_main':10000, | |
6 'building_score_main':1000, | |
7 'building_score_secondary':100, | |
8 'name':'tplayer', | |
9 'research_score_main':122, | |
10 'research_score_secondary':122, | |
11 'score':10000, | |
12 'trader_score_secondary':1000000 | |
13 } | |
14 c("http://localhost:8080/player/create").post(datas) | |
15 | |
16 def edit_player(): | |
17 datas = {'game_id':1, | |
18 'name':'tfplayer' | |
19 } | |
20 c("http://localhost:8080/player/edit").post(datas) | |
21 | |
22 import sys | |
23 | |
24 act = sys.argv[1] | |
25 modelname = sys.argv[2] | |
26 | |
27 funcname = "%s_%s" % (act,modelname) | |
28 print 'test',funcname | |
29 eval(funcname)() |