progress_stream_test.py 563 B

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