diff options
author | Joffrey F <joffrey@docker.com> | 2018-02-14 16:22:33 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-02-14 16:22:33 -0800 |
commit | 4c708f568c55ede2396b01aebf607374f731b3f2 (patch) | |
tree | 6bdced02e445cd7da0de7083e11db9f1f19e5d5f | |
parent | 08803743c55849e71c2a1b62a3f6611e86e2061b (diff) | |
download | docker-py-4c708f568c55ede2396b01aebf607374f731b3f2.tar.gz |
Fix test_login flakes
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r-- | tests/unit/api_test.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/unit/api_test.py b/tests/unit/api_test.py index f65e13e..61d2446 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': { |