Exemplo n.º 1
0
 def test_wrappedProtocolWriteConnectionLost(self):
     """
     L{_WrappingProtocol.writeConnectionLost} should proxy to the wrapped
     protocol's C{writeConnectionLost}
     """
     hcp = TestHalfCloseableProtocol()
     p = endpoints._WrappingProtocol(None, hcp)
     p.writeConnectionLost()
     self.assertEquals(hcp.writeLost, True)
Exemplo n.º 2
0
 def test_wrappingProtocolNotHalfCloseable(self):
     """
     Our L{_WrappingProtocol} should not provide L{IHalfCloseableProtocol}
     if the C{WrappedProtocol} doesn't.
     """
     tp = TestProtocol()
     p = endpoints._WrappingProtocol(None, tp)
     self.assertEquals(
         interfaces.IHalfCloseableProtocol.providedBy(p), False)
Exemplo n.º 3
0
 def test_wrappedProtocolWriteConnectionLost(self):
     """
     L{_WrappingProtocol.writeConnectionLost} should proxy to the wrapped
     protocol's C{writeConnectionLost}
     """
     hcp = TestHalfCloseableProtocol()
     p = endpoints._WrappingProtocol(None, hcp)
     p.writeConnectionLost()
     self.assertEquals(hcp.writeLost, True)
Exemplo n.º 4
0
 def test_wrappingProtocolNotHalfCloseable(self):
     """
     Our L{_WrappingProtocol} should not provide L{IHalfCloseableProtocol}
     if the C{WrappedProtocol} doesn't.
     """
     tp = TestProtocol()
     p = endpoints._WrappingProtocol(None, tp)
     self.assertEquals(interfaces.IHalfCloseableProtocol.providedBy(p),
                       False)
Exemplo n.º 5
0
 def test_wrappingProtocolHalfCloseable(self):
     """
     Our  L{_WrappingProtocol} should be an L{IHalfCloseableProtocol} if
     the C{wrappedProtocol} is.
     """
     cd = object()
     hcp = TestHalfCloseableProtocol()
     p = endpoints._WrappingProtocol(cd, hcp)
     self.assertEquals(
         interfaces.IHalfCloseableProtocol.providedBy(p), True)
Exemplo n.º 6
0
 def test_wrappingProtocolHalfCloseable(self):
     """
     Our  L{_WrappingProtocol} should be an L{IHalfCloseableProtocol} if
     the C{wrappedProtocol} is.
     """
     cd = object()
     hcp = TestHalfCloseableProtocol()
     p = endpoints._WrappingProtocol(cd, hcp)
     self.assertEquals(interfaces.IHalfCloseableProtocol.providedBy(p),
                       True)