Skip to content

Commit 4c708f5

Browse files
committed
Fix test_login flakes
Signed-off-by: Joffrey F <[email protected]>
1 parent 0880374 commit 4c708f5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/unit/api_test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,13 @@ def test_search(self):
214214

215215
def test_login(self):
216216
self.client.login('sakuya', 'izayoi')
217-
fake_request.assert_called_with(
218-
'POST', url_prefix + 'auth',
219-
data=json.dumps({'username': 'sakuya', 'password': 'izayoi'}),
220-
timeout=DEFAULT_TIMEOUT_SECONDS,
221-
headers={'Content-Type': 'application/json'}
222-
)
217+
args = fake_request.call_args
218+
assert args[0][0] == 'POST'
219+
assert args[0][1] == url_prefix + 'auth'
220+
assert json.loads(args[1]['data']) == {
221+
'username': 'sakuya', 'password': 'izayoi'
222+
}
223+
assert args[1]['headers'] == {'Content-Type': 'application/json'}
223224

224225
assert self.client._auth_configs['auths'] == {
225226
'docker.io': {

0 commit comments

Comments
 (0)