def METHOD_NAME(self):
    f = LoopbackFile("r+U")
    f.write(
        b"First line.\nSecond line.\r\nThird line.\n"
        + b"Fourth line.\nFinal line non-terminated."
    )
    self.assertEqual(f.readline(), "First line.\n")
    # universal newline mode should convert this linefeed:
    self.assertEqual(f.readline(), "Second line.\n")
    # truncated line:
    self.assertEqual(f.readline(7), "Third l")
    self.assertEqual(f.readline(), "ine.\n")
    # newline should be detected and only the fourth line returned
    self.assertEqual(f.readline(39), "Fourth line.\n")
    self.assertEqual(f.readline(), "Final line non-terminated.")
    self.assertEqual(f.readline(), "")
    f.close()
    try:
        f.readline()
        self.assertTrue(False, "no exception on readline of closed file")
    except IOError:
        pass
    self.assertTrue(linefeed_byte in f.newlines)
    self.assertTrue(crlf in f.newlines)
    self.assertTrue(cr_byte not in f.newlines)