Ejemplo n.º 1
0
def createSuite():  # 产生测试套件
	base_dir = alldir.get_src_dir()
	testunit = unittest.TestSuite()
	# 使用discover找出用例文件夹下test_case的所有用例
	discover = unittest.defaultTestLoader.discover(base_dir+'src\\test\\test_case\\', pattern="test_*.py", top_level_dir=None)  # 测试模块的顶层目录,即测试用例不是放在多级目录下,设置为none
	for suite in discover:  # 使用for循环出suite,再循环出case
		for case in suite:
			testunit.addTests(case)
	print testunit
	return testunit
Ejemplo n.º 2
0
def url_query():
    config = ConfigParser.ConfigParser()
    config.read(alldir.get_src_dir() + "src\\test\\conf\\conf.conf")
    return config.get("base_url", "url")+'query?wsdl'
Ejemplo n.º 3
0
def net_user_pass():
    config = ConfigParser.ConfigParser()
    config.read(alldir.get_src_dir() + "src\\test\\conf\\conf.conf")
    return config.get("net_user", "pass")
Ejemplo n.º 4
0
def net_channel_name():
    config = ConfigParser.ConfigParser()
    config.read(alldir.get_src_dir() + "src\\test\\conf\\conf.conf")
    return config.get("net_channel", "name")
Ejemplo n.º 5
0
def screen_code():
    config = ConfigParser.ConfigParser()
    config.read(alldir.get_src_dir() + "src\\test\\conf\\conf.conf")
    return config.get("screen_code", "code")