| 247 | ) |
| 248 | |
| 249 | def test_push_image_with_auth(self): |
| 250 | auth_config = { |
| 251 | 'username': "test_user", |
| 252 | 'password': "test_password", |
| 253 | 'serveraddress': "test_server", |
| 254 | } |
| 255 | encoded_auth = auth.encode_header(auth_config) |
| 256 | self.client.push( |
| 257 | fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME, |
| 258 | auth_config=auth_config |
| 259 | ) |
| 260 | |
| 261 | fake_request.assert_called_with( |
| 262 | 'POST', |
| 263 | f"{url_prefix}images/test_image/push", |
| 264 | params={ |
| 265 | 'tag': fake_api.FAKE_TAG_NAME, |
| 266 | }, |
| 267 | data='{}', |
| 268 | headers={'Content-Type': 'application/json', |
| 269 | 'X-Registry-Auth': encoded_auth}, |
| 270 | stream=False, |
| 271 | timeout=DEFAULT_TIMEOUT_SECONDS |
| 272 | ) |
| 273 | |
| 274 | def test_push_image_stream(self): |
| 275 | with mock.patch('docker.auth.resolve_authconfig', |