Permalink
Browse files

Added test.

  • Loading branch information...
nvie committed May 25, 2010
1 parent edd0554 commit 77ceeee8b3bc2575efa20a24cbf85e9cda9d33b0
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests/test_buffered.py
View
@@ -100,3 +100,17 @@ def testWhenCombinedLikeThisTheTimerNeverFires(self):
self.assertEquals(len(self.chunks), 3)
self.assertChunksCountUpTo30()
+ def testWhenCombinedLikeThisTheChunkSizeNeverFires(self):
+ b = BufferedDrainer(['sh', 'fixtures/counter.sh'],
+ read_event_cb=self.collect,
+ chunk_size=40,
+ flush_timeout=2.5)
+ b.start()
+
+ self.assertEquals(self.callback_invoked, 2)
+ self.assertEquals(self.triggered_by_timer, 1)
+ self.assertEquals(self.triggered_by_chunk_size_exceeded, 0)
+ self.assertEquals(self.triggered_otherwise, 1)
+ self.assertEquals(len(self.chunks), 2)
+ self.assertChunksCountUpTo30()
+

0 comments on commit 77ceeee

Please sign in to comment.