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

Python MBT 测试用例

热度1081票  浏览74次 时间:2011年7月19日 10:28
Python学习%y8Px z8X*s Pm;q

@Scenario(Param={Python学习mI.t7s:@~C7? w'vy

Python学习m+yI` |Rmh2m eg

'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]Python学习:RC+z|0^&X*v X

Python学习dq.w;~p)H5zl

, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]Python学习;Aw'zXp:_

/|II7z,c(Mf(|D0}, Where={'combine':['antiSpamLevel', 'actionForSpam'],Python学习Z4?*WG7lj m

:r3PR,bG&RU0'strategy':'add'})Python学习l?#b)dQW`

V\C:pQ9^Q0def AntiSpamSetting(self):Python学习}K1B3Y"y4}

^e5e/rL qNzv0accessTarget = self.accessTargetPython学习T+L(~w\O+K.i6Q

Python学习@!u(Cku pz'g

antiSpamLevel = self.Param['antiSpamLevel']Python学习&u u'i]I8?)qf

*_TVW4~0actionForSpam = self.Param['actionForSpam']

x@ x:{V0 Python学习/R5r![0CiP

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

Hl VP@K_0

c:JB2m M,B z%j0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'

En.C3s*A0 Python学习i h'OSp9k

RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)

.~2`w$GF5U2a(g7n0 Python学习)Oyy!hn;@3{_5I(s

rsp = Filter.getAntiSpamSettings(accessTarget)

fr$E{9p0

)I*ie B.kJ|0if isSetFail:

R,?RP@4j,N+GF0

7ITK*mhcl'BUF0RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)Python学习3K(\/[0p&]`

4hr,j3a{3Jc:E-QX0else:

4ln8rt _6P,i0 Python学习6ZL8vq#s2J

RspCheck(rsp, False, StatusCode.SYS_RESP_OK)Python学习1DqI M'\t

^+[(eURKX*Y u0Assert.AreEqual({"antiSpamLevel":antiSpamLevel, "actionForSpam":actionForSpam}, rsp['data'], 'data check')

|8R\A)K0

%s _'QqF1p SzZs R0Model View 结果:Python学习O0j|{8L&`'w8o

Python学习:q-?A2HM

= 表示 “期望结果是”

BVE!oOVb'P0

)^Pg2G[]$t&k&}0AntiSpamSetting (antiSpamLevel:0) Running ...

$O-YX ~y![/iU0 Python学习3v+P"`"t)ZE

Passed: AntiSpamSetting

_"Q&]:Mz~_0

-xZ%O&wAk0g0AntiSpamSetting1 (actionForSpam:delete) Running ...

&S9UNVd9u0o0 Python学习%[` TFF`:j/l

Passed: AntiSpamSetting

4WUb4} QSo7KNw1g0

&hLE$q E [g0AntiSpamSetting2 (actionForSpam:badAction) Running ...

~1@Z$yZP0 Python学习qC(w7yl1Q

Passed: AntiSpamSettingPython学习KD)V ~3J)e'ONI"U!v

Python学习5tK*N"t"Q-D

AntiSpamSetting3 (antiSpamLevel:1) Running ...

4_V-RFD0

TJ8@-t'U&S0Passed: AntiSpamSettingPython学习(Fi#eW3F

:y!z1`e[;h1f0AntiSpamSetting4 (antiSpamLevel:2) Running ...Python学习Wew"[ GDk

']+u~3A$_;BK9q,r_7?0Passed: AntiSpamSettingPython学习7kOvvR?2D(f`

Python学习7j_)_7fg1| I

AntiSpamSetting5 (antiSpamLevel:3) Running ...

L!f$~D.d0 Python学习z~MkhG

Passed: AntiSpamSetting

*C:MY&]&\?3p#}t0

8W4q @]$O)F0AntiSpamSetting6 (antiSpamLevel:-1) Running ...Python学习 _/QfqT,}

$r z6|F+y~0Passed: AntiSpamSetting

]W|a)w#m4F.Y0
顶:48 踩:60
对本文中的事件或人物打分:
当前平均分:0.04 (335次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.18 (325次打分)
【已经有313人表态】
42票
感动
39票
路过
35票
高兴
35票
难过
42票
搞笑
34票
愤怒
42票
无聊
44票
同情
上一篇 下一篇