文件的绝对路径为:A/B.test_proxy_setting.py
import unittest
class TestProxySettingAPI(APITestCase):
def setUp(self):
self.A=1
def test_case_01_get_proxy_info_when_proxy_disabled(self):
print "This is TestProxySettingAPI-1"
def test_case_02_get_proxy_info_when_proxy_enabled(self):
print "This is TestProxySettingAPI-2"
def tearDownClass(cls):
self.B=2
if __name__ == '__main__':
unittest.main()
-----------------------------------------------------------------------------
import unittest
from A/B import test_proxy_setting
class setTestsuitePool():
def set_testsuite_pool(self):
my_test_suite = unittest.TestSuite()
my_test_suite.addTests([
unittest.defaultTestLoader.loadTestsFromTestCase(test_proxy_setting.TestProxySettingAPI)
])
return my_test_suite
if __name__ == "__main__":
tp = setTestsuitePool()
test_suite = tp.set_testsuite_pool()
print test_suite