Fix test_login flakes

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-02-14 16:22:33 -08:00
parent 08803743c5
commit 4c708f568c
1 changed files with 7 additions and 6 deletions

View File

@ -214,12 +214,13 @@ class DockerApiTest(BaseAPIClientTest):
def test_login(self): def test_login(self):
self.client.login('sakuya', 'izayoi') self.client.login('sakuya', 'izayoi')
fake_request.assert_called_with( args = fake_request.call_args
'POST', url_prefix + 'auth', assert args[0][0] == 'POST'
data=json.dumps({'username': 'sakuya', 'password': 'izayoi'}), assert args[0][1] == url_prefix + 'auth'
timeout=DEFAULT_TIMEOUT_SECONDS, assert json.loads(args[1]['data']) == {
headers={'Content-Type': 'application/json'} 'username': 'sakuya', 'password': 'izayoi'
) }
assert args[1]['headers'] == {'Content-Type': 'application/json'}
assert self.client._auth_configs['auths'] == { assert self.client._auth_configs['auths'] == {
'docker.io': { 'docker.io': {