예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)