def testRegularFunction(self):
s = SimpleProtocol()
c = SimpleProtocol()
def sendALine(result):
s.sendLine("THIS IS LINE ONE!")
s.transport.loseConnection()
s.conn.addCallback(sendALine)
def check(ignored):
self.assertEquals(c.lines, ["THIS IS LINE ONE!"])
self.assertEquals(len(s.connLost), 1)
self.assertEquals(len(c.connLost), 1)
d = defer.maybeDeferred(self.loopbackFunc, s, c)
d.addCallback(check)
return d
评论列表
文章目录