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

Python MBT 测试用例

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

*n/P |H'Z5Iq9s0@Scenario(Param={

%LH0~*iDl0

/B6lq0R;`T&eEd;D:c0'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]

r+Ps.I1Wk0

Pn)~+y J2jB/J0, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]Python学习Vq"z$x8URx)|

Python学习YD9kt,n"l

}, Where={'combine':['antiSpamLevel', 'actionForSpam'],Python学习$~|5X%brPys*X

Python学习R"u5x%F!c]0X1E

'strategy':'add'})Python学习L+`wXi{;O.hn:} N

wV)}[p(d&ZsQW0def AntiSpamSetting(self):

'W7VkF%@4W0 Python学习#Y wD8P4O@9k3w'kN

accessTarget = self.accessTarget

2~S{EE3fEU0

Fe*R[ f7K~0antiSpamLevel = self.Param['antiSpamLevel']

K])W B*n_Kx0 Python学习R0h4l+xj'Q6x3|

actionForSpam = self.Param['actionForSpam']

yM(oIwO0 Python学习ci'v8yw0y8N

rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)

Zj~%P(o&B0

ue[4_r3H6j9nM0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'Python学习 Njg!V4OF3W G'{9_

Python学习4C}'y+Ew7Ql;T

RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习w\;b/{PX

Python学习&h~qVPx

rsp = Filter.getAntiSpamSettings(accessTarget)

ar4_;{#F]/P#k0

+WU^r&r9^)a V}7w0if isSetFail:Python学习3Yn%p0[f`&}P%v$J

p:@@$h J@i Db0RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)

[W8fc!D0 Python学习zn!Z8?0C6rZS

else:

~oR9S#M%M[4VV0 Python学习JCO\.w|a2G

RspCheck(rsp, False, StatusCode.SYS_RESP_OK)

6C*J.S8Es?0

:|CcB^LxM0Assert.AreEqual({"antiSpamLevel":antiSpamLevel, "actionForSpam":actionForSpam}, rsp['data'], 'data check')

(a-T0R JW'W0

(uGadOS_2|0Model View 结果:Python学习wWW*g O5Ti6y Lh l

Python学习u S Y"k lH3Y

= 表示 “期望结果是”Python学习at;Y-M~ o

Python学习R'na0E"y8DG)U

AntiSpamSetting (antiSpamLevel:0) Running ...

[+}TS,qL~0 Python学习Zk1g^ C5J9@ U

Passed: AntiSpamSetting

UR^-^.d;}0 Python学习8@:f-D UU5y1E2k ` i

AntiSpamSetting1 (actionForSpam:delete) Running ...

~n-}+j+@ [?0 Python学习Q-us^$W_$a0T

Passed: AntiSpamSettingPython学习 ~9m\([gU;h o

4Kg1F)pvA~fxz0AntiSpamSetting2 (actionForSpam:badAction) Running ...

!sq?/zc I0 Python学习~Ru0{dl lr

Passed: AntiSpamSetting

.d(^~HnEjJ0 Python学习,lsE8\h y:w/n,I

AntiSpamSetting3 (antiSpamLevel:1) Running ...Python学习$[lev}:Z|

Python学习'v k Y(Y:A'b

Passed: AntiSpamSetting

z f2Hq }/xj ]bB0

d bi5S0Y.k0AntiSpamSetting4 (antiSpamLevel:2) Running ...

&d:um6PGN-c:J0 Python学习 s|Q#SNaHi{

Passed: AntiSpamSettingPython学习 y${nyoN:z1p

Python学习0[#|4j'C1WxF-U)_4B

AntiSpamSetting5 (antiSpamLevel:3) Running ...

/S2rL m9n `:R+^N0 Python学习A2C.qn oU

Passed: AntiSpamSetting

8g^-~M"{@0

,KgKV B7x^$D CA&Bp0AntiSpamSetting6 (antiSpamLevel:-1) Running ...

tg!l%M5L/M ^0 Python学习mB'b2w;m&Ei.{ ?8R

Passed: AntiSpamSettingPython学习%t2u#v,I)\ t)Bx c

顶:40 踩:53
对本文中的事件或人物打分:
当前平均分:0.01 (284次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.18 (278次打分)
【已经有266人表态】
38票
感动
30票
路过
32票
高兴
29票
难过
33票
搞笑
28票
愤怒
37票
无聊
39票
同情
上一篇 下一篇