Ejemplo n.º 1
0
 def test_addresses(self):
     """
     L{LocalWorkerTransport.getPeer} and L{LocalWorkerTransport.getHost}
     return L{IAddress} objects.
     """
     localTransport = LocalWorkerTransport(None)
     self.assertTrue(verifyObject(IAddress, localTransport.getPeer()))
     self.assertTrue(verifyObject(IAddress, localTransport.getHost()))
Ejemplo n.º 2
0
 def test_addresses(self):
     """
     L{LocalWorkerTransport.getPeer} and L{LocalWorkerTransport.getHost}
     return L{IAddress} objects.
     """
     localTransport = LocalWorkerTransport(None)
     self.assertTrue(verifyObject(IAddress, localTransport.getPeer()))
     self.assertTrue(verifyObject(IAddress, localTransport.getHost()))
Ejemplo n.º 3
0
    def test_loseConnection(self):
        """
        L{LocalWorkerTransport.loseConnection} forwards the call to the given
        transport.
        """
        transport = FakeTransport()
        localTransport = LocalWorkerTransport(transport)
        localTransport.loseConnection()

        self.assertEqual(transport.calls, 1)
Ejemplo n.º 4
0
 def test_writeSequence(self):
     """
     L{LocalWorkerTransport.writeSequence} forwards the written data to the
     given transport.
     """
     transport = FakeTransport()
     localTransport = LocalWorkerTransport(transport)
     data = (b"The quick ", b"brown fox jumps ", b"over the lazy dog")
     localTransport.writeSequence(data)
     self.assertEqual(b"".join(data), transport.dataString)
Ejemplo n.º 5
0
 def test_write(self):
     """
     L{LocalWorkerTransport.write} forwards the written data to the given
     transport.
     """
     transport = FakeTransport()
     localTransport = LocalWorkerTransport(transport)
     data = b"The quick brown fox jumps over the lazy dog"
     localTransport.write(data)
     self.assertEqual(data, transport.dataString)
Ejemplo n.º 6
0
    def test_loseConnection(self):
        """
        L{LocalWorkerTransport.loseConnection} forwards the call to the given
        transport.
        """
        transport = FakeTransport()
        localTransport = LocalWorkerTransport(transport)
        localTransport.loseConnection()

        self.assertEqual(transport.calls, 1)
Ejemplo n.º 7
0
 def test_writeSequence(self):
     """
     L{LocalWorkerTransport.writeSequence} forwards the written data to the
     given transport.
     """
     transport = FakeTransport()
     localTransport = LocalWorkerTransport(transport)
     data = ("The quick ", "brown fox jumps ", "over the lazy dog")
     localTransport.writeSequence(data)
     self.assertEqual("".join(data), transport.dataString)
Ejemplo n.º 8
0
 def test_write(self):
     """
     L{LocalWorkerTransport.write} forwards the written data to the given
     transport.
     """
     transport = FakeTransport()
     localTransport = LocalWorkerTransport(transport)
     data = "The quick brown fox jumps over the lazy dog"
     localTransport.write(data)
     self.assertEqual(data, transport.dataString)
Ejemplo n.º 9
0
 def test_transport(self):
     """
     L{LocalWorkerTransport} implements L{ITransport} to be able to be used
     by L{AMP}.
     """
     localTransport = LocalWorkerTransport(None)
     self.assertTrue(verifyObject(ITransport, localTransport))