Add some unit tests for new bundle and push commands.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
33cc601176
commit
db02c9f537
3 changed files with 270 additions and 20 deletions
|
|
@ -65,3 +65,23 @@ class ProgressStreamTestCase(unittest.TestCase):
|
|||
|
||||
events = progress_stream.stream_output(events, output)
|
||||
self.assertTrue(len(output.getvalue()) > 0)
|
||||
|
||||
|
||||
def test_get_digest_from_push():
|
||||
digest = "sha256:abcd"
|
||||
events = [
|
||||
{"status": "..."},
|
||||
{"status": "..."},
|
||||
{"progressDetail": {}, "aux": {"Digest": digest}},
|
||||
]
|
||||
assert progress_stream.get_digest_from_push(events) == digest
|
||||
|
||||
|
||||
def test_get_digest_from_pull():
|
||||
digest = "sha256:abcd"
|
||||
events = [
|
||||
{"status": "..."},
|
||||
{"status": "..."},
|
||||
{"status": "Digest: %s" % digest},
|
||||
]
|
||||
assert progress_stream.get_digest_from_pull(events) == digest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue