Пример #1
0
 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")
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 def __init__(self):
     test = lcc.Test("mytest", "My Test", dummy_test_callback())
     test.disabled = True
     add_test_into_suite(test, self)
Пример #6
0
 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)
Пример #7
0
 def __init__(self):
     add_test_into_suite(lcc.Test("mytest", "My Test", SomeTest()),
                         self)
Пример #8
0
 def __init__(self):
     add_test_into_suite(lcc.Test("mytest", "My Test", self.func), self)
Пример #9
0
 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)
Пример #10
0
 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)
Пример #11
0
        def __init__(self):
            def test_func():
                lcc.log_info("somelog")

            test = lcc.Test("mytest", "My Test", test_func)
            add_test_into_suite(test, self)
Пример #12
0
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
        )