Example #1
0
 def test_callback_invoked(self):
     original_stream = six.StringIO('foobarbaz')
     wrapped = StreamReaderProgress(original_stream,
                                    [self.callback, self.callback])
     self.assertEqual(wrapped.read(), 'foobarbaz')
     self.assertEqual(self.amounts_seen, [9, 9])
Example #2
0
 def test_proxies_to_wrapped_stream(self):
     original_stream = six.StringIO('foobarbaz')
     wrapped = StreamReaderProgress(original_stream)
     self.assertEqual(wrapped.read(), 'foobarbaz')