作者在 2016-10-18 21:29:02 发布以下内容
if __name__ == '__main__':
# unittest.main()
try:
# 跑一个class
# suite1 = unittest.TestLoader().loadTestsFromTestCase(HELLO)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(SALES_QUERY_ACK)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(UNBIND)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(ESL_QUERY)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(AP_REPORT)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(ESL_LIST)
suite1 = unittest.TestLoader().loadTestsFromTestCase(BIND_LIST)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(ESL_NETLINK)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(API_VERSION)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(AP_LIST)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(AP_QUERY)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(ESL_INFO)
# suite1 = unittest.TestLoader().loadTestsFromTestCase(ESL_UPDATE)
unittest.TextTestRunner().run(suite1)
except Exception,e:
print "%d error"
finally:
pass
#这个是跑指定多个case
# caselist = ("test_case262","test_case263","test_case264","test_case265","test_case266","test_case267","test_case268")
# regSuite = unittest.TestSuite()
# while True:
# for tmpcase in caselist:
# regSuite.addTest(ESL_NETLINK(tmpcase))
# unittest.TextTestRunner().run(regSuite)
#这个是调试单个case
# regSuite = unittest.TestSuite()
# regSuite.addTest(ESL_NETLINK("test_case267"))
# regSuite.addTest(TEMPLATE_UPDATE("test_case887"))
# unittest.TextTestRunner().run(regSuite)