예제 #1
0
def run_tests():
    for filename in glob('tests/*.json'):
        data = json.load(open(filename))
        params, response = data['params'], data['response']
        got = parse(**data['params'])
        for index, item in enumerate(response):
            if len(got) != len(response) or got[index] != response[index]:
                print(
                    "Полученный и ожидаемый массивы различаются, получен: {} ожидался: {}, файл {}"
                    .format(str(got), str(response), filename))
                return
    print("All tests passed!")
def run_tests():
    for filename in glob('tests/*.json'):
        data = json.load(open(filename))
        params, response = data['params'], data['response']
        got = parse(**params)
        if len(got) != len(response):
            print(error_message.format(str(got), str(response), filename))
        for index, item in enumerate(response):
            if got[index] != response[index]:
                print(error_message.format(str(got), str(response), filename))
                return
    print("All tests passed!")