def test_hw1(file_path): result_path = check_data(file_path, [validate_date, validate_line]) with open(result_path) as res: for i, line in enumerate(res, start=1): assert line.rsplit(" ", 1)[0] in data assert i == len(data) - 1
def test_real_file(): result_path = check_data("data.txt", [validate_date, validate_line]) with open(result_path) as res: for i, _ in enumerate(res, start=1): pass assert i == 777