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

Python MBT 测试用例

热度951票  浏览69次 时间:2011年7月19日 10:28
Python学习.v7B S%QUt

@Scenario(Param={Python学习ejZ!p&m }{T5o

Python学习"s1B9O;vC+{j#d0B0I"}

'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]Python学习'L6?%T#SY!v

$iY!b2FTj0, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]

C0A*EL,Gb0 Python学习 C&E-^rS

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

nAr\"B0

e;mS7k}\Z e0'strategy':'add'})

[-u:vjqb&Dnfd0

2P+O)\!^jw-~EQ{0def AntiSpamSetting(self):

o'y@EmyE'}U;b0 Python学习{$S1z(x6u/}5{*|

accessTarget = self.accessTargetPython学习vl'xj R!E.Y

)h G1vq;cQ6u%]!O0antiSpamLevel = self.Param['antiSpamLevel']Python学习4J@ aj4RSa-N

L-Z*{d| eZ/{ X?0actionForSpam = self.Param['actionForSpam']

[Q;Ya{+in0 Python学习@wnM3lo `5]

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

"z:n OS^-_0T(}0

R1b'MK(|i-XmH0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'Python学习`!V$X1A)yDE

Python学习V j{ A:oU

RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习K^LZ_Z1VXzyg

Python学习r;Zi&ZL9X

rsp = Filter.getAntiSpamSettings(accessTarget)Python学习Q4|0jf9`9{ _n:B'i

Python学习#K:B{I+T-@+V#S

if isSetFail:

"L3J*f]F0 Python学习9?HT{;x,u+\+Sl

RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)Python学习5|n#@i E6o5ku K5j

Python学习z}8iP1O N7L^ M.T

else:

6`OK5my2l&rE#Y0

O{&v} n0O_E0RspCheck(rsp, False, StatusCode.SYS_RESP_OK)Python学习 q!GE3nfa

Python学习$p9gZ/?9Ve4z

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

0lN?$V&D1yek0

I5MGD8] E0Model View 结果:Python学习 B*{'Z6aX

Python学习5JLX;d3`i f

= 表示 “期望结果是”

{9gGk%M`U Fo0

T5D6Yl/HGna0AntiSpamSetting (antiSpamLevel:0) Running ...

*S{~8cz8`W0

5zbc7fA&\@V~4z0Passed: AntiSpamSetting

N O%j A;WgDVm3X:F0

"B4f;B?,{%Ie;B0AntiSpamSetting1 (actionForSpam:delete) Running ...Python学习S"yn-t0o&V

Python学习 D&ma(f]1X

Passed: AntiSpamSetting

?EtI'}S8W4\0

Z(L"B,\%iR.Q0AntiSpamSetting2 (actionForSpam:badAction) Running ...Python学习 C1j WOgvb&TJ

i7p-k^-}+l0Passed: AntiSpamSetting

8E&lE3d r0n7}%~0 Python学习j[d.zX*n9T!E

AntiSpamSetting3 (antiSpamLevel:1) Running ...

m%t `.I }#Ai0 Python学习l"H.`Y$n9^'v

Passed: AntiSpamSetting

G\zzGDy0 Python学习$Pjo Mdyz)e

AntiSpamSetting4 (antiSpamLevel:2) Running ...

X|kJl/D0

ru4_1U o+Ek X:R'M0Passed: AntiSpamSetting

Eg0qw1v0 Python学习'Hj\%EsD)Yv9s

AntiSpamSetting5 (antiSpamLevel:3) Running ...Python学习?4a2as/w7N1N~f

Python学习6Ubd Q(P+AmT0jMbS

Passed: AntiSpamSetting

_ F"?4CN&VGv(|(H0 Python学习h7a%^!Yf3k,O9~

AntiSpamSetting6 (antiSpamLevel:-1) Running ...

3Q]/h*pjik;[?0

ne6H*ES)Q%lM0Passed: AntiSpamSettingPython学习A i:J5i+V{

顶:42 踩:55
对本文中的事件或人物打分:
当前平均分:0.03 (294次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.12 (287次打分)
【已经有273人表态】
39票
感动
31票
路过
32票
高兴
30票
难过
34票
搞笑
29票
愤怒
38票
无聊
40票
同情
上一篇 下一篇