MBT????MTest??????????????????
???????????? ???????[ 2013/7/29 14:01:40 ] ????????
????MBT?????????????2???????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Щ?????????????á?
????????????????????????????????????????????????е??????????е????????????????к???????????????????????????£?
????????????
from MTest import TestCaseBase?? Model?? Scenario?? Action?? Assert?? Logger
@Action(DespFormat="Called with {0}?? {1}")
def JustReturnArg1(arg1?? arg2):
if arg1 == 1:
return arg2
return arg1
@Model()
class SimpleModel(TestCaseBase):
@Scenario(Param={
'p1':[1?? 2]??
'p2':['a'?? 'b']
}?? Where={'combine':['p1'??'p2']??'strategy':'add'})
def TestJustReturnSelf(self):
Logger.Step('Call JustReturnSelf and Validate')
p1 = self.Param['p1']
p2 = self.Param['p2']
rsp = JustReturnArg1(p1?? p2)
Assert.AreEqual(p1?? rsp?? 'p1 check')
if __name__ == '__main__':
import sys
from MTestLauncher import MTestLoader
MTestLoader.Run(None?? False?? "MTestRunConfig.xml"?? [sys.argv[0]]??
"mtest")
????????к?????3??????????
@Model(TestModule="")
def SimpleModel(TestCaseBase):
@Scenario(Param={'p1': 1?? 'p2': 'a'})
def TestJustReturnSelf_p1(self):
Logger.Step("Call JustReturnSelf and Validate")
rsp1 = JustReturnArg1(self.Param["p1"]??
self.Param["p2"])
Assert.AreEqual(self.Param["p1"]?? rsp1?? "p1 check")
@Scenario(Param={'p1': 1?? 'p2': 'b'})
def TestJustReturnSelf1_p2(self):
Logger.Step("Call JustReturnSelf and Validate")
rsp1 = JustReturnArg1(self.Param["p1"]??
self.Param["p2"])
Assert.AreEqual(self.Param["p1"]?? rsp1?? "p1 check")
@Scenario(Param={'p1': 2?? 'p2': 'a'})
def TestJustReturnSelf2_p1(self):
Logger.Step("Call JustReturnSelf and Validate")
rsp1 = JustReturnArg1(self.Param["p1"]??
self.Param["p2"])
Assert.AreEqual(self.Param["p1"]?? rsp1?? "p1 check")
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11