def test_endsInNewline(self):
        """
        L{text.endsInNewline} returns C{True} if the string ends in a newline.
        """
        s = 'newline\n'
        m = text.endsInNewline(s)
        self.assertTrue(m)

        s = 'oldline'
        m = text.endsInNewline(s)
        self.assertFalse(m)

        L{text.endsInNewline} returns C{True} if the string ends in a newline.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_text.py