-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using unittest for tests, fixed some errors, added gitignore
- Loading branch information
Showing
3 changed files
with
27 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pyc |
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 |
---|---|---|
@@ -1,4 +1,19 @@ | ||
from . import api | ||
import unittest | ||
|
||
if __name__ == "__main__": | ||
test_client = api.Client() | ||
import api | ||
|
||
|
||
class TestAPIMethods(unittest.TestCase): | ||
def test_client(self): | ||
""" Should successfully establish the client. """ | ||
api_token = 'correct_token' | ||
self.assertTrue(api.Client(api_token)) | ||
|
||
def test_client_wrong_token(self): | ||
""" Should raise exception when wrong API token is provided. """ | ||
wrong_api_token = 'wrong token' | ||
self.assertRaises(Exception, api.Client, wrong_api_token) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |