Merge pull request #1464 from twhiteman/bug1461
Possible division by zero error when pulling an image - fixes #1463
(cherry picked from commit d0e87929a1)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
8749bc0844
commit
5a5bffebd1
2 changed files with 21 additions and 2 deletions
|
|
@ -17,3 +17,21 @@ class ProgressStreamTestCase(unittest.TestCase):
|
|||
]
|
||||
events = progress_stream.stream_output(output, StringIO())
|
||||
self.assertEqual(len(events), 1)
|
||||
|
||||
def test_stream_output_div_zero(self):
|
||||
output = [
|
||||
'{"status": "Downloading", "progressDetail": {"current": '
|
||||
'0, "start": 1413653874, "total": 0}, '
|
||||
'"progress": "..."}',
|
||||
]
|
||||
events = progress_stream.stream_output(output, StringIO())
|
||||
self.assertEqual(len(events), 1)
|
||||
|
||||
def test_stream_output_null_total(self):
|
||||
output = [
|
||||
'{"status": "Downloading", "progressDetail": {"current": '
|
||||
'0, "start": 1413653874, "total": null}, '
|
||||
'"progress": "..."}',
|
||||
]
|
||||
events = progress_stream.stream_output(output, StringIO())
|
||||
self.assertEqual(len(events), 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue