Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def response(status_code=200, content='', headers=None, reason=None, elapsed=0,
return res


def fake_resolve_authconfig(authconfig, registry=None):
return None


def fake_resp(url, data=None, **kwargs):
status_code, content = fake_api.fake_responses[url]()
return response(status_code=status_code, content=content)
Expand Down Expand Up @@ -1174,7 +1178,9 @@ def test_insert_image(self):

def test_push_image(self):
try:
self.client.push(fake_api.FAKE_IMAGE_NAME)
with mock.patch('docker.auth.auth.resolve_authconfig',
fake_resolve_authconfig):
self.client.push(fake_api.FAKE_IMAGE_NAME)
except Exception as e:
self.fail('Command should not raise exception: {0}'.format(e))

Expand All @@ -1188,7 +1194,9 @@ def test_push_image(self):

def test_push_image_stream(self):
try:
self.client.push(fake_api.FAKE_IMAGE_NAME, stream=True)
with mock.patch('docker.auth.auth.resolve_authconfig',
fake_resolve_authconfig):
self.client.push(fake_api.FAKE_IMAGE_NAME, stream=True)
except Exception as e:
self.fail('Command should not raise exception: {0}'.format(e))

Expand Down