def testLineTooLong(self):
"""
Test sending a line too long: it should close the connection.
"""
t = StringIOWithoutClosing()
a = LineOnlyTester()
a.makeConnection(protocol.FileWrapper(t))
res = a.dataReceived('x'*200)
self.assertTrue(isinstance(res, error.ConnectionLost))
评论列表
文章目录