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.1 From 619c11787742ce00a0ee8f841cec075897873c79 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 8 Jun 2010 16:47:48 +0200 Subject: Its getting better already - intermediate commit before further chaning the task class --- test/git/async/test_channel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 25eb974c..ab4ae015 100644 --- a/test/git/async/test_channel.py +++ b/test/git/async/test_channel.py @@ -42,5 +42,9 @@ class TestChannels(TestBase): self.failUnlessRaises(IOError, wc.write, 1) # reading from a closed channel never blocks + print "preblock" assert len(rc.read()) == 0 - + print "got read(0)" + assert len(rc.read(5)) == 0 + assert len(rc.read(1)) == 0 + -- cgit v1.2.1