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

Python MBT 测试用例

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

9f\E `wO L3J.Y0@Scenario(Param={Python学习:{G1U|!Up z2D

,BA8Zq*bj9T0'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]Python学习| lP:rF V,YF

Python学习$z3UoCs dB

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

!x C.ar)No @d0}, Where={'combine':['antiSpamLevel', 'actionForSpam'],

,dXad.E5f`0 Python学习0EMP)p8E{P&oOU

'strategy':'add'})

M3y `8Nz LP$s0

P{ h jCj-Yq(V0def AntiSpamSetting(self):

:A!rD;X+x$R i8A5}0 Python学习#s,w3a5M,R&cg e

accessTarget = self.accessTarget

%B;Cd w-@#H6EH V0 Python学习:s!Vpr/T9xA'K;Y

antiSpamLevel = self.Param['antiSpamLevel']

zyf TYC0 Python学习uMh1h0j$G:rV:T

actionForSpam = self.Param['actionForSpam']

Z-w&p!aG~0

VD+ff9C G0rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)Python学习oeeF(oa[0N

6]7Lv+h9|&R#kooM0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'Python学习,Cf%h }3qZ:v

Python学习iw,Ey@8}'o|

RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习J+jMO }$I ^

Python学习$zAiY+b zx

rsp = Filter.getAntiSpamSettings(accessTarget)

oS9A3K4C0 Python学习"V$X,m~wF

if isSetFail:

M#H,jk-u:zI0 Python学习 k&E"A%yac*V+{:RH1v

RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)Python学习D:u&i5o^7w)D

&\E!gRve{KF0else:

P-O/BF*\3\jU i0

q/zE%^!W,p7x0RspCheck(rsp, False, StatusCode.SYS_RESP_OK)Python学习#HK,^0hf;UUrM/E

Python学习J{ Y*m(p!v8R

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

$eb [s@0 Python学习-\-i ?4r!i:`N

Model View 结果:Python学习#S.J_;O'p5G/Y

Python学习GF'J6I/th+qX

= 表示 “期望结果是”Python学习#r(gW^-jW6Hv1zG

v+M|ew U.gR0AntiSpamSetting (antiSpamLevel:0) Running ...

~X`M[+D0 Python学习+q*acBU2LW

Passed: AntiSpamSetting

ow4cT,ik+R3k7D0 Python学习Qb3W!}5Ac@q I1u

AntiSpamSetting1 (actionForSpam:delete) Running ...Python学习D j"t5Y"i Cz

4q@Pz,N0Passed: AntiSpamSetting

z {1a-?]1Lw0

(l7vQZu0Sw)Mn E4{ ?0AntiSpamSetting2 (actionForSpam:badAction) Running ...

qpfi7`&G0 Python学习 zB\ Me_,H

Passed: AntiSpamSettingPython学习"|i'C}7[5E7zx

Python学习a'p9D~:F{!_

AntiSpamSetting3 (antiSpamLevel:1) Running ...Python学习cJ0k X9t(N(B)~c

Python学习CXugm8`

Passed: AntiSpamSetting

o,Kr~)KoJ.Z1F(Nn0 Python学习} L9J\!t@

AntiSpamSetting4 (antiSpamLevel:2) Running ...

6eV-uS b$u:x)k?+S e0

GgT(`8{ G(W0Passed: AntiSpamSettingPython学习s$w)k[K s_} w)^

@5_]*RS4p0AntiSpamSetting5 (antiSpamLevel:3) Running ...

Mp-](H1jH0

;^ B.gwsQZg"_:q0Passed: AntiSpamSetting

3{+El`]0

X}3{,C6M1E0AntiSpamSetting6 (antiSpamLevel:-1) Running ...

Nez7I;{;l L$j0 Python学习4W'C2i+Sj4m;p

Passed: AntiSpamSetting

$oc'Yo N r/b5~CP0
顶:40 踩:53
对本文中的事件或人物打分:
当前平均分:0.02 (287次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.17 (279次打分)
【已经有267人表态】
38票
感动
30票
路过
32票
高兴
29票
难过
34票
搞笑
28票
愤怒
37票
无聊
39票
同情
上一篇 下一篇