progress_stream_test.py 575 B

1234567891011121314151617181920
  1. from __future__ import unicode_literals
  2. from __future__ import absolute_import
  3. from tests import unittest
  4. import mock
  5. from six import StringIO
  6. from compose import progress_stream
  7. class ProgressStreamTestCase(unittest.TestCase):
  8. def test_stream_output(self):
  9. output = [
  10. '{"status": "Downloading", "progressDetail": {"current": '
  11. '31019763, "start": 1413653874, "total": 62763875}, '
  12. '"progress": "..."}',
  13. ]
  14. events = progress_stream.stream_output(output, StringIO())
  15. self.assertEqual(len(events), 1)