Cloud-CV / evalai-cli

:cloud: :rocket: Official EvalAI Command Line Tool
https://cli.eval.ai
BSD 3-Clause "New" or "Revised" License
55 stars 63 forks source link

Add tests for get_user_access_token method #307

Open Ram81 opened 3 years ago

Ram81 commented 3 years ago

Description

Add tests for get_user_access_token method in evalai/utils/auth.py.

ShauryaAg commented 3 years ago

@Ram81 I would like to work on this issue. But I am a little unfamiliar with the working of this method. From what I see, this method takes the auth token as input and returns the same token again as output?

Can you help me with this?

Ram81 commented 3 years ago

@ShauryaAg the method accepts a expiring auth token as a parameter and makes API call to evalai backend to get an Access Token. Expiring auth tokens expire when user logs out but the access token can be used to make api calls irrespective of login state

ShauryaAg commented 3 years ago

@Ram81 sorry about the confusion, my local clone was not up-to-date.

I would like to take this issue.

Ram81 commented 3 years ago

@ShauryaAg Sure, go ahead.

ShauryaAg commented 3 years ago

@Ram81 The test for get_user_access_token are already written in test_get_token.py. As get_token reads from the same file (~/.evalai/token.json) as set during login (which calls utils.auth.get_user_auth_token_by_login and utils.auth.get_user_access_token).