From 4c708f568c55ede2396b01aebf607374f731b3f2 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 14 Feb 2018 16:22:33 -0800 Subject: [PATCH] Fix test_login flakes Signed-off-by: Joffrey F --- tests/unit/api_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit/api_test.py b/tests/unit/api_test.py index f65e13ec..61d24460 100644 --- a/tests/unit/api_test.py +++ b/tests/unit/api_test.py @@ -214,12 +214,13 @@ class DockerApiTest(BaseAPIClientTest): def test_login(self): self.client.login('sakuya', 'izayoi') - fake_request.assert_called_with( - 'POST', url_prefix + 'auth', - data=json.dumps({'username': 'sakuya', 'password': 'izayoi'}), - timeout=DEFAULT_TIMEOUT_SECONDS, - headers={'Content-Type': 'application/json'} - ) + args = fake_request.call_args + assert args[0][0] == 'POST' + assert args[0][1] == url_prefix + 'auth' + assert json.loads(args[1]['data']) == { + 'username': 'sakuya', 'password': 'izayoi' + } + assert args[1]['headers'] == {'Content-Type': 'application/json'} assert self.client._auth_configs['auths'] == { 'docker.io': {