def _deliver(self, data, *expected):
        """
        Pass the given bytes to the protocol's C{dataReceived} method and
        assert that the given events occur.
        """
        received = self.protocol.events = []
        self.protocol.dataReceived(data)
        self.assertEqual(received, list(expected))

        Pass the given bytes to the protocol's C{dataReceived} method and
        assert that the given events occur.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_telnet.py