From 3776f7a766851058f6435b9f606b16766425d7ca Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 8 Jun 2010 13:24:44 +0200 Subject: The new channeldesign actually works, but it also shows that its located at the wrong spot. The channel is nothing more than an adapter allowing to read multiple items from a thread-safe queue, the queue itself though must be 'closable' for writing, or needs something like a writable flag. --- test/git/async/test_channel.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'test/git/async/test_channel.py') diff --git a/test/git/async/test_channel.py b/test/git/async/test_channel.py index acfbd15e..25eb974c 100644 --- a/test/git/async/test_channel.py +++ b/test/git/async/test_channel.py @@ -43,26 +43,4 @@ class TestChannels(TestBase): # reading from a closed channel never blocks assert len(rc.read()) == 0 - - - - # TEST LIMITED SIZE CHANNEL - # channel with max-items set - wc, rc = Channel(1) - wc.write(item) # fine - - # blocks for a a moment, its full - st = time.time() - self.failUnlessRaises(EOFError, wc.write, item, True, to) - assert time.time() - st >= to - - # get our only one - assert rc.read(1)[0] == item - - # its empty,can put one again - wc.write(item2) - wc.close() - - # reading 10 will only yield one, it will not block as its closed - assert rc.read(10, timeout=1)[0] == item2 - + -- cgit v1.2.3