你的位置:Python学习 >> 资讯 >> 经验分享 >> 详细内容 在线投稿

Python MBT 测试用例

热度1095票  浏览75次 时间:2011年7月19日 10:28

e:z3Z8~zl4^ho0@Scenario(Param={

gDh&\o5I0 Python学习2C]T%sZ2cOx

'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]Python学习C0d^2b Y

Python学习+vN~8TRq$D

, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]Python学习R4Y:M0Kzs

,rJ!eSK#v1cEy0}, Where={'combine':['antiSpamLevel', 'actionForSpam'],Python学习@?\-hTd:@

{@"J dC _w\D0'strategy':'add'})Python学习|9FC:C)ztc

Python学习lSC C5D

def AntiSpamSetting(self):Python学习HW/CaC:T#AvQ

:i,_H*Uq(r0accessTarget = self.accessTarget

T ?1`1ht%r#~5|~0 Python学习1y{&?O@6hRUv4v

antiSpamLevel = self.Param['antiSpamLevel']Python学习5^9s'~*f:X'Kt M'F

Python学习&z3]#sg+V

actionForSpam = self.Param['actionForSpam']Python学习5gPS v4G?(x

1Nuq9p? g1x0rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)Python学习*aC@3F4w E5b?G

Python学习m,PrX5}&tY.`/IC

isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'Python学习X Hsx(T'yhRk

nM0[7GIKdS `c0RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习h&j)E4r Bt'e8gB

Python学习{4O R;a#u'P

rsp = Filter.getAntiSpamSettings(accessTarget)Python学习![bz!PX#N

8o(t U{ y-ldk g,F tm0if isSetFail:

"b;REZk/A0

dB {#c0~&O%PV0RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)Python学习` Z$\#cVd"u$b

Python学习i5Y1p/~.? R T7M9^ S[

else:

)p$uN+v)FK"q0

5OIk8j iZ0RspCheck(rsp, False, StatusCode.SYS_RESP_OK)Python学习s*d_6R T h_

!WA Ye a0Assert.AreEqual({"antiSpamLevel":antiSpamLevel, "actionForSpam":actionForSpam}, rsp['data'], 'data check')Python学习Yj V\K

Python学习[ p:m"r4A

Model View 结果:Python学习w d9}EF

G0sM4HPE;X0= 表示 “期望结果是”Python学习3t yp!G4rzi P

i y.WT#J&ij:Q JV0AntiSpamSetting (antiSpamLevel:0) Running ...Python学习,n dn8T9~Y"g

h;h:y8h NZ$dCq0Passed: AntiSpamSetting

5kY Y hCTF5W }0 Python学习1uI"Bmf.M| p2[ r

AntiSpamSetting1 (actionForSpam:delete) Running ...Python学习En|hrm9w

Python学习Ov)oLx

Passed: AntiSpamSettingPython学习]+?sE#L&n~

Python学习v~n$Wr9pnG,e6P2]

AntiSpamSetting2 (actionForSpam:badAction) Running ...

X;p]|m:`1DL.Q0 Python学习q)V$r ASn Rc8v&q

Passed: AntiSpamSettingPython学习$TW(@p']Wr

uUc|e;Js0AntiSpamSetting3 (antiSpamLevel:1) Running ...Python学习eL0x*mUO

&R#N3vp,SH-@0Passed: AntiSpamSettingPython学习 G]kBl3a(b

]2p!a iEP'GS,Z2K0AntiSpamSetting4 (antiSpamLevel:2) Running ...

k#_ X-M4j0

0b8~~Y'X{0Passed: AntiSpamSettingPython学习3yO/S2X~]:h7V&r

Python学习%~'_Bc e e Su

AntiSpamSetting5 (antiSpamLevel:3) Running ...Python学习 W#PhpQ2kE

Python学习F @0B4[O"VA s

Passed: AntiSpamSettingPython学习 VLC'{ BYFJ#y

Python学习E!GS^2Q#h"}*{ m

AntiSpamSetting6 (antiSpamLevel:-1) Running ...Python学习o$CCG!f#g.?

l5@*LE)n"c&s0Passed: AntiSpamSettingPython学习q-U WV!p

顶:48 踩:61
对本文中的事件或人物打分:
当前平均分:0.05 (339次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.17 (330次打分)
【已经有317人表态】
43票
感动
39票
路过
37票
高兴
35票
难过
42票
搞笑
34票
愤怒
43票
无聊
44票
同情
上一篇 下一篇