def test_integration(input_s, expected_retval, output, tmpdir): path = tmpdir.join('file.txt') path.write_binary(input_s) ret = end_of_file_fixer([path.strpath]) file_output = path.read_binary() assert file_output == output assert ret == expected_retval
def test_integration(input_s, expected_retval, output, tmpdir): file_path = os.path.join(tmpdir.strpath, 'file.txt') with open(file_path, 'wb') as file_obj: file_obj.write(input_s) ret = end_of_file_fixer([file_path]) file_output = open(file_path, 'rb').read() assert file_output == output assert ret == expected_retval