Exemplo n.º 1
0
def create_suite(testset):
    """ create test suite with a testset, it may include one or several testcases.
        each suite should initialize a seperate TestRunner() with testset config.
    """
    suite = unittest.TestSuite()

    test_runner = runner.TestRunner()
    config_dict = testset.get("config", {})
    test_runner.update_context(config_dict, level="testset")
    testcases = testset.get("testcases", [])

    for testcase in testcases:
        test = ApiTestCase(test_runner, testcase)
        suite.addTest(test)

    return suite
Exemplo n.º 2
0
 def setUp(self):
     self.test_runner = runner.TestRunner()
     self.clear_users()