summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-05-25 17:10:51 +0100
committerLars Wirzenius <liw@liw.fi>2011-05-25 17:10:51 +0100
commit41a137be9ce99cc5d955711df94ce130d15da92c (patch)
tree72d9407129e0df8dc67c6773a7815da773fad90a
parent74e1e4396f72c37c888eac3db163b471ecbedc6a (diff)
downloadbgproc-41a137be9ce99cc5d955711df94ce130d15da92c.tar.gz
Make wait_for_results return False initially.
Queue is empty, so there can be no more results.
-rw-r--r--bgproc.py1
-rw-r--r--bgproc_tests.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/bgproc.py b/bgproc.py
index 6f7c4c5..73aa052 100644
--- a/bgproc.py
+++ b/bgproc.py
@@ -42,6 +42,7 @@ class BackgroundProcessing(object):
because all requests have been processed.
'''
+ return False
def __iter__(self):
'''Iterate over immediately available results.'''
diff --git a/bgproc_tests.py b/bgproc_tests.py
index 4e1a87e..5dbe53c 100644
--- a/bgproc_tests.py
+++ b/bgproc_tests.py
@@ -34,3 +34,7 @@ class BackgroundProcessingTests(unittest.TestCase):
def test_no_pending_requests_initially(self):
self.assertEqual(self.bg.pending_requests, 0)
+
+ def test_wait_for_results_returns_false_initially(self):
+ self.assertEqual(self.bg.wait_for_results(), False)
+