-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Increase coverage by testing exceptions. * Add coverage for RequestException handling * Add meaningful function names * Add meaningful function names
- Loading branch information
1 parent
22e22b5
commit 9719a9f
Showing
6 changed files
with
303 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import shutil | ||
from click.testing import CliRunner | ||
|
||
from evalai.challenges import challenges | ||
from evalai.utils.config import AUTH_TOKEN_DIR | ||
|
||
from tests.base import BaseTestClass | ||
|
||
|
||
class TestGetUserAuthToken(BaseTestClass): | ||
|
||
def setup(self): | ||
if os.path.exists(AUTH_TOKEN_DIR): | ||
shutil.rmtree(AUTH_TOKEN_DIR) | ||
|
||
def test_get_user_auth_token_when_file_does_not_exist(self): | ||
expected = ("\nYour token file doesn't exists.\n" | ||
"\nIt should be present at ~/.evalai/token.json\n\n") | ||
runner = CliRunner() | ||
result = runner.invoke(challenges) | ||
response = result.output | ||
assert response == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.