def test_write(self):
        """
        L{TuntapPort.write} sends a datagram into the tunnel.
        """
        datagram = b"a b c d e f g"
        self.port.startListening()
        self.port.write(datagram)
        self.assertEqual(
            self.system.getTunnel(self.port).writeBuffer,
            deque([datagram]))

        L{TuntapPort.write} sends a datagram into the tunnel.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/pair/test/test_tuntap.py