fix test for changed APIError message

This commit is contained in:
Robert Kaussow 2020-12-15 14:17:17 +01:00
parent b8340cbb59
commit 6e00398663
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61

View File

@ -364,7 +364,9 @@ def test_api_call_with_timeout(mocker, gc):
def test_api_call_with_api_error(mocker, gc): def test_api_call_with_api_error(mocker, gc):
func = mocker.Mock( func = mocker.Mock(
side_effect=docker.errors.APIError( side_effect=docker.errors.APIError(
"Ooops", mocker.Mock(status_code=409, reason="Conflict"), explanation="failed" "Ooops",
mocker.Mock(status_code=409, reason="Conflict", url="dummy"),
explanation="failed"
), ),
__name__="remove_image" __name__="remove_image"
) )
@ -376,7 +378,7 @@ def test_api_call_with_api_error(mocker, gc):
func.assert_called_once_with(image="abcd") func.assert_called_once_with(image="abcd")
mock_log.warn.assert_called_once_with( mock_log.warn.assert_called_once_with(
"Error calling remove_image image=abcd " "Error calling remove_image image=abcd "
'409 Client Error: Conflict ("failed")' '409 Client Error for dummy: Conflict ("failed")'
) )