def testDiscard(self): t = StringIOWithoutClosing() a = wire.Discard() a.makeConnection(protocol.FileWrapper(t)) a.dataReceived("hello") a.dataReceived("world") a.dataReceived("how") a.dataReceived("are") a.dataReceived("you") self.failUnlessEqual(t.getvalue(), "")
def test_discard(self): """ Test wire.Discard protocol. """ t = proto_helpers.StringTransport() a = wire.Discard() a.makeConnection(t) a.dataReceived("hello") a.dataReceived("world") a.dataReceived("how") a.dataReceived("are") a.dataReceived("you") self.assertEqual(t.value(), "")