def __init__(self): add_tests_in_suite( [lcc.Test("test1", "My Test 1", dummy_test_callback())], self) add_tests_in_suite( [lcc.Test("test2", "My Test 2", dummy_test_callback())], self, before_test="test") add_tests_in_suite( [lcc.Test("test3", "My Test 3", dummy_test_callback())], self, after_test="test")
def __init__(self): data = [ 'Musaceae', 'Anacardiaceae', 'Rutaceae', 'Cucurbitaceae', 'Solanaceae', 'Bromeliaceae', 'Rosaceae' ] for family in data: url = ''.join( ['http://www.fruityvice.com/api/fruit/family/', family]) test = lcc.Test(family, ''.join(['Get all by ', family]), CheckByFamily(url)) lcc.add_test_into_suite(test, self)
def __init__(self): # print("file name") # print(PROJECT_DIR) # print(__file__) data = json.load(open(osp.join(PROJECT_DIR, "data.json"))) counter = 0 for entry in data: counter = counter + 1 testname = f'Test case number {counter}' test = lcc.Test(testname, testname, TestAdd(entry["i"], entry["j"], entry["expected"])) lcc.add_test_into_suite(test, self)
def __init__(self): data = json.load(open(osp.join(PROJECT_DIR, "data.json"))) for entry in data: test = lcc.Test(entry["name"], entry["description"], TestAdd(entry["i"], entry["j"], entry["expected"])) lcc.add_test_into_suite(test, self)
def __init__(self): test = lcc.Test("mytest", "My Test", dummy_test_callback()) test.disabled = True add_test_into_suite(test, self)
def __init__(self): for i in 1, 2, 3: add_test_into_suite( lcc.Test("mytest_%d" % i, "My Test %d" % i, dummy_test_callback()), self)
def __init__(self): add_test_into_suite(lcc.Test("mytest", "My Test", SomeTest()), self)
def __init__(self): add_test_into_suite(lcc.Test("mytest", "My Test", self.func), self)
def __init__(self): add_test_into_suite( lcc.Test("mytest", "First test", dummy_test_callback()), self) add_test_into_suite( lcc.Test("mytest", "Second test", dummy_test_callback()), self)
def __init__(self): for i in range(4): def dummy(): lcc.log_info("do test dyn %d" % i) lcc.add_test_into_suite(lcc.Test("test_%d" % i, "This is my dynamic test %d" % i, dummy), self)
def __init__(self): def test_func(): lcc.log_info("somelog") test = lcc.Test("mytest", "My Test", test_func) add_test_into_suite(test, self)
def register_tests(suite, nb_tests): for i in range(nb_tests): lcc.add_test_into_suite( lcc.Test("test_%d" % (i + 1), "Test %d" % (i + 1), test_echo), suite )