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

Python MBT 测试用例

热度986票  浏览69次 时间:2011年7月19日 10:28
Python学习 c*e5f0n&DS6R X6R

@Scenario(Param={Python学习0o,M;GKUVW0v#r

Python学习Dp0[U U|-b%Pvx

'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]

;~[#F;x#Xcbj&H4]#Q0 Python学习_ i af*h8]-R

, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]Python学习5|i{9R4c

Python学习f Wh+z8DE n `

}, Where={'combine':['antiSpamLevel', 'actionForSpam'],Python学习|N`rh7}r%y

gh*ls @Ya*DV S0'strategy':'add'})Python学习'g,Sx8Z9_(D

#l$E)S+?nn&mD0def AntiSpamSetting(self):

]U*n"fD9[8vCMy"B$r0

xbzGG ^{a0accessTarget = self.accessTargetPython学习vl;da6Q;n/oYS

"Y;D3C#^,{g2T0antiSpamLevel = self.Param['antiSpamLevel']Python学习)\K:W[3H

/uy9{?/{)S~Yok(}0actionForSpam = self.Param['actionForSpam']Python学习7Gi(r m7o1]*O*`y\

7{Y!gH@kz0rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)Python学习0j/}t$|.K.l5V a1{1U

;r,R7f,M5{$\8A0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'Python学习)k#h.wek-i G-d@\ J9W8`

_[q pM0RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)

Cl9My9I,pi0

Ty YA{)?-ED n0rsp = Filter.getAntiSpamSettings(accessTarget)

/Xs(o1nt~0 Python学习\^[:I8O/e.e

if isSetFail:Python学习vEp T3f V*Te

Python学习Ry@i9glbJ Q

RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)Python学习/S5G4WcD

F1oS{ c9n$@1G0else:

?/f6RI }Z:p0

]eA*D3u8|%RF0RspCheck(rsp, False, StatusCode.SYS_RESP_OK)

#QC#mQM^5w0

vVX_?cN0Assert.AreEqual({"antiSpamLevel":antiSpamLevel, "actionForSpam":actionForSpam}, rsp['data'], 'data check')

vZ^t\ {R6h0

%zH#uxsl0Model View 结果:Python学习7F FKa#hs$YsR

T o3C[O^&n0= 表示 “期望结果是”

S:^;|5q9Py*Yn0 Python学习I Z$a6R(N

AntiSpamSetting (antiSpamLevel:0) Running ...Python学习f/j|A(mH

Python学习 j4H9LLp5u(|A H7?

Passed: AntiSpamSetting

2oD-\[S o9l0

`T#S9XC_#I0AntiSpamSetting1 (actionForSpam:delete) Running ...

C F!BBP!L:i0

3IG LD.uEq0Passed: AntiSpamSetting

o/rR){^+R0

wbW@&N0AntiSpamSetting2 (actionForSpam:badAction) Running ...

g/rr$xy,wy&]0 Python学习 {~8H!J`B m

Passed: AntiSpamSetting

8S-a3{+j!D#h-u-pv|&v0

P Y C3I9M}T0AntiSpamSetting3 (antiSpamLevel:1) Running ...

~r'vZ;k0

-Dm5a k ~r3on#rII0Passed: AntiSpamSettingPython学习n!B}7f P'C:N

wTi!nOU0AntiSpamSetting4 (antiSpamLevel:2) Running ...

N:OD&c?5ZDM0

e.`'v{$U1`g*v;n0Passed: AntiSpamSettingPython学习6fx1`6_3L'XB'[

Python学习qdF7RR0RT"B

AntiSpamSetting5 (antiSpamLevel:3) Running ...Python学习%C U&gpZ]hY

!rT6b$@j@"| U0Passed: AntiSpamSettingPython学习'S#d9l/r"S? n

Python学习-XV2^E8`.|4A

AntiSpamSetting6 (antiSpamLevel:-1) Running ...Python学习q}/m5R*DZ1]

Python学习T"m;g,U S O E1F6_

Passed: AntiSpamSetting

D;dQ+Y2[2QblV$G0
顶:42 踩:56
对本文中的事件或人物打分:
当前平均分:0.02 (307次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.11 (295次打分)
【已经有286人表态】
40票
感动
33票
路过
33票
高兴
33票
难过
35票
搞笑
31票
愤怒
40票
无聊
41票
同情
上一篇 下一篇