def METHOD_NAME(self, test_data):
    test_data = textwrap.dedent(test_data)
    mode = 'w'
    if sys.platform != 'cygwin':
        mode += 't'
    temp_fd, temp_filename = tempfile.mkstemp()
    with os.fdopen(temp_fd, mode=mode) as fp:
        fp.write(test_data)
    self.addCleanup(os.unlink, temp_filename)
    return netrc.netrc(temp_filename)