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

Python MBT 测试用例

热度1104票  浏览76次 时间:2011年7月19日 10:28
Python学习%d*ZBK)|$dc8}

@Scenario(Param={Python学习]LiZZ-mK

nC ][|TU!ejp0'antiSpamLevel':['0', '1', '2', {'t':'invalid', 'v':3}, {'t':'invalid', 'v':-1}]Python学习tL}#L!gX?*B

7Ceb*C3A8\ eV0, 'actionForSpam':['reserve', 'delete', {'t':'invalid', 'v':'badAction'}]Python学习8}N ]#ga^M

Python学习.s*[&R#W;m^

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

^ uX0uO6i0 Python学习+n@6OKIK_

'strategy':'add'})Python学习2zD,P?N6PKz

Sq Hn$PpL.t8O0def AntiSpamSetting(self):

!SX{K3y^j k@0

|7jo$P*GdeWP0accessTarget = self.accessTargetPython学习 B!~!c J&s

)zp(z-IMR|x4c4C0antiSpamLevel = self.Param['antiSpamLevel']Python学习dd e-JA4fU

tY IFz2E$x Cr0actionForSpam = self.Param['actionForSpam']Python学习v(\0h/a;_#ZT7|%K!Q

C(T-rP!A^!g0rsp = Filter.UpdateAntiSpamSettings(accessTarget, antiSpamLevel, actionForSpam)

)cd@A^GG0

4X2Z.E(otH8c&K#t0isSetFail = self.Param.GetType('antiSpamLevel') == 'invalid' or self.Param.GetType('actionForSpam') == 'invalid'

'q+d:z&O'? y;G0 Python学习coJ ]/LN,t

RspCheck(rsp, True, StatusCode.SYS_REQ_PARAM_INVALID if isSetFail else StatusCode.SYS_RESP_OK)Python学习x9l'|M1n2nA

)co$F$W2ynyH ?I0rsp = Filter.getAntiSpamSettings(accessTarget)Python学习5T(pQ8EW*I$X LH

Python学习)zsf8om/?zk,@3B

if isSetFail:

YZa#nC&_;p-x/QWX t0 Python学习 Lx G*M(X)be!F4x0b)?

RspCheck(rsp, True, StatusCode.APP_MBOX_FILTER_ANTISPAM_NOTEXIST)

\L(Gu8Pa0 Python学习mz*M9w"n#Ho(p~ { c

else:Python学习7`qBX/{g(g

jJ!IpB T0RspCheck(rsp, False, StatusCode.SYS_RESP_OK)

.vd/q,i.`(@&z(V0

L7z Y:`,aTS8I P2s0Assert.AreEqual({"antiSpamLevel":antiSpamLevel, "actionForSpam":actionForSpam}, rsp['data'], 'data check')Python学习)~ CU[gO?

Python学习/W a0Qm`&V

Model View 结果:Python学习 \N0P:SXQG&P

Python学习'v~7WfI/|(A7k&g

= 表示 “期望结果是”

lT1Xqv6t.~0

(_][^?P:E D'E@/P0AntiSpamSetting (antiSpamLevel:0) Running ...

@,gW#F'k t0 Python学习X%P2E `?x&C@ l [+ob

Passed: AntiSpamSetting

QT9}~!^ cP(f0

/}5C z7fw%C0AntiSpamSetting1 (actionForSpam:delete) Running ...

(U ^;l r9N u2@8sTH0

zW y e0I%})Y0Passed: AntiSpamSettingPython学习 uB6sl8l

D!i$w TC:m*n0AntiSpamSetting2 (actionForSpam:badAction) Running ...

;Q"P UK [0

!p([ DxAl9Q8MD9O0Passed: AntiSpamSetting

(t;}P^f@B2P1A0

OG a{,m5yj0AntiSpamSetting3 (antiSpamLevel:1) Running ...Python学习I6zzW A#A;sBp

g u_Mx6^3fj,C#J)E0Passed: AntiSpamSetting

i~!w }-s1LQ7Z0 Python学习6PJ.{I E

AntiSpamSetting4 (antiSpamLevel:2) Running ...Python学习4SI5G:PO

Python学习'y L z @Y/R1?^ _

Passed: AntiSpamSettingPython学习0b6TNV(T{9K1w

+^A9w.GG:Gbz0AntiSpamSetting5 (antiSpamLevel:3) Running ...Python学习i R(MvKq5r:z5UP

2Mp#j_)V#_1b0ayw0Passed: AntiSpamSettingPython学习7O*k5]yk'k

Python学习1A![e8D_0v/mH&N

AntiSpamSetting6 (antiSpamLevel:-1) Running ...Python学习XK2~\ oK UWO ho

Python学习A7wq4Y9Ukx]S Z

Passed: AntiSpamSettingPython学习@or9]%{k,eG

顶:48 踩:61
对本文中的事件或人物打分:
当前平均分:0.04 (342次打分)
对本篇资讯内容的质量打分:
当前平均分:-0.16 (332次打分)
【已经有321人表态】
45票
感动
39票
路过
37票
高兴
35票
难过
42票
搞笑
34票
愤怒
44票
无聊
45票
同情
上一篇 下一篇