def test_writeSequence(self): """ L{FakeTransport.writeSequence} will write a sequence of L{bytes} to the transport. """ a = FakeTransport(object(), False) a.write(b"a") a.writeSequence([b"b", b"c", b"d"]) self.assertEqual(b"".join(a.stream), b"abcd")
def test_writeAfterClose(self): """ L{FakeTransport.write} will accept writes after transport was closed, but the data will be silently discarded. """ a = FakeTransport(object(), False) a.write(b"before") a.loseConnection() a.write(b"after") self.assertEqual(b"".join(a.stream), b"before")
def test_writeSequence(self): """ L{FakeTransport.writeSequence} will write a sequence of L{bytes} to the transport. """ a = FakeTransport(object(), False) a.write(b"a") a.writeSequence([b"b", b"c", b"d"]) self.assertEqual(b"".join(a.stream), b"abcd")