예제 #1
0
    def test_callback_invoked(self):
        amounts_seen = []

        def callback(amount):
            amounts_seen.append(amount)

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

        def callback(amount):
            amounts_seen.append(amount)

        original_stream = six.StringIO('foobarbaz')
        wrapped = StreamReaderProgress(original_stream, callback)
        self.assertEqual(wrapped.read(), 'foobarbaz')
        self.assertEqual(amounts_seen, [9])
예제 #3
0
 def test_proxies_to_wrapped_stream(self):
     original_stream = six.StringIO('foobarbaz')
     wrapped = StreamReaderProgress(original_stream)
     self.assertEqual(wrapped.read(), 'foobarbaz')
예제 #4
0
 def test_proxies_to_wrapped_stream(self):
     original_stream = six.StringIO('foobarbaz')
     wrapped = StreamReaderProgress(original_stream)
     self.assertEqual(wrapped.read(), 'foobarbaz')