国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 利川市| 屯留县| 驻马店市| 塔城市| 高尔夫| 新宁县| 南召县| 册亨县| 历史| 沙河市| 茌平县| 濮阳市| 鄱阳县| 南昌县| 肇源县| 手游| 正阳县| 平顶山市| 泽州县| 伊春市| 名山县| 德化县| 新野县| 巴塘县| 河北区| 兴安县| 隆子县| 晋城| 卢氏县| 许昌县| 呼玛县| 红安县| 呼伦贝尔市| 耿马| 天津市| 富民县| 洛川县| 高青县| 体育| 富川| 青田县|