def test_exactWrite(self):
        """
        The literal returns an empty L{bytes} instance when given
        exactly the data the literal requires.
        """
        data = b"complete"
        literal = self.literalFactory(len(data), self.deferred)
        leftover = literal.write(data)

        self.assertIsInstance(leftover, bytes)
        self.assertFalse(leftover)
        self.assertNoResult(self.deferred)

        The literal returns an empty L{bytes} instance when given
        exactly the data the literal requires.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py