- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
def execute_test_cases(api_tester):
"""
Запускает выполнение тестов, собранных в tester.py
:param api_tester: объект класса для тестирования API
:type api_tester: ApiTester
"""
test_cases = reversed([x for x in dir(TestCases) if re.match('^[A-Z][a-zA-Z\d]*$', x)])
for test_name in test_cases:
print "\n\n================= ** %s ** ==================" % test_name
test_case = getattr(TestCases, test_name)
method = re.sub('^_', '', re.sub('([A-Z])', '_\\1', test_name)).lower()
test_case_variants = [x for x in dir(test_case) if re.match('^[a-z][\w\d]+$', x)]
for variant in test_case_variants:
getattr(api_tester, method)(getattr(test_case, variant)())
Комментарии (0) RSS
Добавить комментарий