Skip to content

Commit

Permalink
Give this a burl -- might fix gtk.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@15240 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
  • Loading branch information
jml committed Nov 29, 2005
1 parent cc90210 commit 5815c2b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions twisted/test/test_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,17 +903,22 @@ def tearDown(self):
self.client.transport.loseConnection()
return self.p.stopListening()

def _delayDeferred(self, time, arg=None):
from twisted.internet import reactor
d = defer.Deferred()
reactor.callLater(time, d.callback, arg)
return d

def testNoNotification(self):
client = self.client
f = self.f
client.transport.write("hello")
w = client.transport.write
client.transport.loseWriteConnection()
reactor.iterate()
reactor.iterate()
reactor.iterate()
self.assertEquals(f.protocol.data, "hello")
self.assertEquals(f.protocol.closed, True)
d = self._delayDeferred(0.2, f.protocol)
d.addCallback(lambda x : self.assertEqual(f.protocol.data, 'hello'))
d.addCallback(lambda x : self.assertEqual(f.protocol.closed, True))
return d

def testShutdownException(self):
client = self.client
Expand Down

0 comments on commit 5815c2b

Please sign in to comment.