国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python測試驅(qū)動開發(fā)實例

2020-02-23 06:03:06
字體:
供稿:網(wǎng)友

本文實例講述了python測試驅(qū)動開發(fā)的方法,分享給大家供大家參考。具體方法如下:

import unittest from main import Sample class SampleTest(unittest.TestCase):    def setUp(self):     print "create a new Sample"     self._sample = Sample("b64e5843ca7db8199c405be565fa7f57")   def tearDown(self):     print "Destory the sample"     self._sample = None    def test_GetVirusNameFromVT(self):     "this md5 has the VT info"     aSample = Sample("b64e5843ca7db8199c405be565fa7f57")     dict_virusName = aSample._GetVirusNameFromVT()     self.assertTrue(dict_virusName!=None)   def test_GetVirusNameFromVT2(self):     "this md5 has not the VT info"     aSample = Sample("2b666ffe98e465523e514d2b93b7666a")     dict_virusName = aSample._GetVirusNameFromVT ()     self.assertTrue(len(dict_virusName) == 0)   if __name__=="__main__":   #unittest.main()   suite = unittest.TestLoader().loadTestsFromTestCase(SampleTest)   unittest.TextTestRunner(verbosity=2).run(suite) 

希望本文所述對大家的Python程序設計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 越西县| 华蓥市| 景洪市| 宁河县| 辉县市| 镇江市| 松原市| 故城县| 吴忠市| 大余县| 苗栗县| 邯郸市| 柳江县| 宁远县| 水城县| 景泰县| 深州市| 津南区| 芦山县| 济源市| 金山区| 沙湾县| 大渡口区| 化州市| 洪泽县| 页游| 沂水县| 剑川县| 贞丰县| 石泉县| 乌海市| 仙游县| 岑溪市| 恩施市| 册亨县| 绵竹市| 车致| 永寿县| 梧州市| 泰安市| 嘉义市|