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

Python MBT 测试用例

热度1059票  浏览72次 时间:2011年7月19日 10:28
Python学习+d#^ ? v"FV(s"O$jBT Y

@Scenario(Param={Python学习4N4Z&BeB

Python学习8t9vg%{x3g#Zx$s$^

'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]Python学习3EX9a,}#gmzR

Python学习/os#I yQ Q i

, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]

m5y!N&bY.q!|%J4P0 Python学习(fWI'F+\"w8Aw

}, Where={'combine':['antiSpamLevel', 'actionForSpam'],Python学习nL u\5P\

zD#k mB0'strategy':'add'})Python学习4A!I'ftv;w)d3z

DRsW&J { HR,MU9l0def AntiSpamSetting(self):

P8a.{#lp Y;om0

BR@zf4h|1x0accessTarget = self.accessTargetPython学习_+MDd+zHa

\+a&y)z |7wP0antiSpamLevel = self.Param['antiSpamLevel']Python学习(T([&qZ"C F

r$c[1BB]!PE(B0actionForSpam = self.Param['actionForSpam']Python学习&Cl1nIK `h

'^Mg/WdgC:W4C0rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)

+Y T]RQ0

6YM:L{d0A5Z0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'

[$]$d0BcC f^9a0 Python学习+m-KH7W;y2[ X

RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习`FL9ZL7\7@(C

Python学习0eBc6k uw@

rsp = Filter.getAntiSpamSettings(accessTarget)Python学习G'IR.a;T M K

'Y(U+C5kI }Kqd0if isSetFail:

7d4L@|v;~0

8R3`9o9N:O$]Z&]0RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)

0n lN` G,z]0 Python学习0`rR.i5myh7]&I

else:Python学习 }(w}~%hl \~

Python学习v0w@5u7x W

RspCheck(rsp, False, StatusCode.SYS_RESP_OK)

6[%t3a+{"O UT_0

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

^(G6?7^2RIN!v0

3C;Zy | h*}*O.C0Model View 结果:

G%|6B o_:m}0tLwt0

'F(k:Xy ]i0= 表示 “期望结果是”Python学习e;p^ `z1g\

Python学习4D,[7q5h4e KdS/Y2e

AntiSpamSetting (antiSpamLevel:0) Running ...

oqA[E(}%p0

X/S$cd @Yh_0Passed: AntiSpamSetting

V#yPony| w(V0

k-Nc5~m+cd0AntiSpamSetting1 (actionForSpam:delete) Running ...Python学习!}J$G$B hP}

Python学习4k1q E3r^|(f*V

Passed: AntiSpamSetting

5R F9o#r:h:E h;IU2P"h0 Python学习KOY4];nzW:_-H

AntiSpamSetting2 (actionForSpam:badAction) Running ...

%ZL2Q-Y;{6`N0 Python学习zQ%U6qR

Passed: AntiSpamSetting

iJ cb8}-QP0 Python学习6Qk4bt1EIT

AntiSpamSetting3 (antiSpamLevel:1) Running ...Python学习7r.IP"o!d1YB_,@ bF

Python学习'y!x3NLg?

Passed: AntiSpamSetting

O0z)Y*RY0 Python学习m,zqc]4E?3{3P@3dc

AntiSpamSetting4 (antiSpamLevel:2) Running ...Python学习 V+OUX4LUp:F)L

Python学习"q.`+k3EJ]Z

Passed: AntiSpamSetting

)eX`v/pLZ0 Python学习^ Q"b:W a)?

AntiSpamSetting5 (antiSpamLevel:3) Running ...Python学习-c5@}@0_

cwA/m.^mh,nP![0Passed: AntiSpamSetting

)m }k4E8v3J%bsu8g0 Python学习$W@0l*x#u0C

AntiSpamSetting6 (antiSpamLevel:-1) Running ...Python学习 vT cj)jLR

C3jNp:|cu9Q0Passed: AntiSpamSettingPython学习Mt#X6? }+_.s

顶:46 踩:58
对本文中的事件或人物打分:
当前平均分:0.06 (331次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.17 (318次打分)
【已经有306人表态】
41票
感动
39票
路过
34票
高兴
35票
难过
40票
搞笑
33票
愤怒
40票
无聊
44票
同情
上一篇 下一篇