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

Python MBT 测试用例

热度1080票  浏览73次 时间:2011年7月19日 10:28
Python学习 W6\:HTA]'?F

@Scenario(Param={

6@F { lTg0N _0 Python学习n"n0Q FydG:b

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

;p8XAy twx0

R*{|u$?,aB G0, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]Python学习^.t5`[Fu'MNT0H

Python学习 M+xy M ON-BR/H

}, Where={'combine':['antiSpamLevel', 'actionForSpam'],

Szc1j!ft0

IP"S _%Gxav.U0'strategy':'add'})

l`X-K2fzd1G%o0 Python学习:O/|f1C9T(q3@

def AntiSpamSetting(self):

}yL\,]L{#{.pk0

6P@)`}9D&] w0accessTarget = self.accessTarget

_1N rV4hVC;y[0

/mT gM0i'~/h|0antiSpamLevel = self.Param['antiSpamLevel']Python学习*@ztpb ]xL0e

Python学习,?)K+~ZV

actionForSpam = self.Param['actionForSpam']Python学习,SOa5j.[x eg&c

;s t1v@k Lv1qLc.?0rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)Python学习5w8k'eKv

C0a [ dbPb&z0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'Python学习 o!MVQ1n8y&un8[

B9u"p8cR ?0RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习Kbz f3tl"Ex#~

2X$o4r,hhN2F+}0rsp = Filter.getAntiSpamSettings(accessTarget)

Oik J5e3j8W7W0 Python学习\gf"p:wO*|

if isSetFail:

};x%r#HDEY0

3GDu?-^ Zn$M0RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)Python学习AM M*HW F

Python学习l |#a ]5MiW

else:

QE^&e E*Pj\0

*m\3X h9F|,u;v"J9]7K0RspCheck(rsp, False, StatusCode.SYS_RESP_OK)Python学习,]F(wj)r:{

.y7FC8^"~u:r0Assert.AreEqual({"antiSpamLevel":antiSpamLevel, "actionForSpam":actionForSpam}, rsp['data'], 'data check')Python学习$Wt6w8wc._fV

*J,jB/m$DC0Model View 结果:Python学习5H5AIoW6\8dnS

?*vQrdVm5|%Z ~0= 表示 “期望结果是”Python学习,p0o@3}X uz{

Python学习.zN,u8Un3prR$~

AntiSpamSetting (antiSpamLevel:0) Running ...Python学习0|i\'i _&A R

_uT:m n@&J7J!TR0Passed: AntiSpamSettingPython学习~hdEw"P,z4F

u-a`g6v-D/c-C Q0AntiSpamSetting1 (actionForSpam:delete) Running ...Python学习c _mSY

;b,a.H\8yqB4\0Passed: AntiSpamSettingPython学习 yp ?:FTDh$r

'MIW_\6C0AntiSpamSetting2 (actionForSpam:badAction) Running ...

%Y[H;o*q)L6uN ta0

?W6Q)RV-c0Passed: AntiSpamSetting

5V5L W6h d,UM0 Python学习S y%O-yTF _"|[ b.U

AntiSpamSetting3 (antiSpamLevel:1) Running ...Python学习O/_J9i(Ohd}

Python学习 Tdau+h C&@_}b(G

Passed: AntiSpamSettingPython学习3v ?G9pE6G"CSo2a;[+Zn

Python学习1A$k!QZ1i.J9o

AntiSpamSetting4 (antiSpamLevel:2) Running ...Python学习&M7z"o9V/L_$w9l,?

Python学习hI/w@Aj_

Passed: AntiSpamSettingPython学习h"\@@cx]$D

Python学习4RTsNY2Fa

AntiSpamSetting5 (antiSpamLevel:3) Running ...Python学习4^F*r.h6b]d E:F

Python学习 X1B#@m&skUq/w&n|xe

Passed: AntiSpamSetting

H#QZ:U_e \+`;]c0 Python学习B6^4w&ui E"dQ

AntiSpamSetting6 (antiSpamLevel:-1) Running ...

HXMz,o d0

8|K$R2R`0Passed: AntiSpamSetting

2Om;l8E m"uk&h0
顶:48 踩:60
对本文中的事件或人物打分:
当前平均分:0.04 (335次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.18 (324次打分)
【已经有313人表态】
42票
感动
39票
路过
35票
高兴
35票
难过
42票
搞笑
34票
愤怒
42票
无聊
44票
同情
上一篇 下一篇