-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from ucfopen/develop
Release v0.8.2
- Loading branch information
Showing
7 changed files
with
50 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
|
||
__all__ = ["Canvas"] | ||
|
||
__version__ = '0.8.1' | ||
__version__ = '0.8.2' |
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 |
---|---|---|
|
@@ -3,8 +3,10 @@ | |
"method": "POST", | ||
"endpoint": "accounts/1/logins", | ||
"data": { | ||
"id": 123, | ||
"unique_id": 112233 | ||
"account_id": 1, | ||
"id": 101, | ||
"unique_id": "[email protected]", | ||
"user_id": 1 | ||
}, | ||
"status_code": 200 | ||
}, | ||
|
@@ -14,50 +16,51 @@ | |
"data": [ | ||
{ | ||
"account_id": 1, | ||
"id": 2, | ||
"sis_user_id": null, | ||
"id": 101, | ||
"unique_id": "[email protected]", | ||
"user_id": 2, | ||
"authentication_provider_id": 1, | ||
"authentication_provider_type": "facebook" | ||
"user_id": 1 | ||
} | ||
], | ||
"headers": { | ||
"Link": "<http://example.com/api/v1/accounts/1/logins/?page=2&per_page=2>; rel=\"next\"" | ||
"Link": "<http://example.com/api/v1/accounts/1/logins/?page=2&per_page=1>; rel=\"next\"" | ||
}, | ||
"status_code": 200 | ||
}, | ||
"list_user_logins_2": { | ||
"method": "GET", | ||
"endpoint": "accounts/1/logins/?page=2&per_page=2", | ||
"endpoint": "accounts/1/logins/?page=2&per_page=1", | ||
"data": [ | ||
{ | ||
"account_id": 2, | ||
"id": 3, | ||
"account_id": 1, | ||
"id": 102, | ||
"sis_user_id": null, | ||
"unique_id": "belieber@example.com", | ||
"user_id": 3, | ||
"authentication_provider_id": 2, | ||
"unique_id": "facebook@example.com", | ||
"user_id": 1, | ||
"authentication_provider_id": 1, | ||
"authentication_provider_type": "facebook" | ||
} | ||
], | ||
"status_code": 200 | ||
}, | ||
"edit_user_login": { | ||
"method": "PUT", | ||
"endpoint": "accounts/123/logins/112233", | ||
"endpoint": "accounts/1/logins/101", | ||
"data": { | ||
"id": 123, | ||
"unique_id": 112233 | ||
"account_id": 1, | ||
"id": 101, | ||
"unique_id": "[email protected]", | ||
"user_id": 1 | ||
}, | ||
"status_code": 200 | ||
}, | ||
"delete_user_login": { | ||
"method": "DELETE", | ||
"endpoint": "users/123/logins/112233", | ||
"endpoint": "users/1/logins/101", | ||
"data": { | ||
"id": 123, | ||
"unique_id": 112233 | ||
"account_id": 1, | ||
"id": 101, | ||
"unique_id": "[email protected]", | ||
"user_id": 1 | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -450,23 +450,28 @@ def test_list_user_logins(self, m): | |
|
||
# create_user_login() | ||
def test_create_user_login(self, m): | ||
register_uris({'account': ['create_user_login']}, m) | ||
register_uris({'login': ['create_user_login']}, m) | ||
|
||
response = self.account.create_user_login(user={'id': 123}, login={'unique_id': 112233}) | ||
unique_id = '[email protected]' | ||
|
||
response = self.account.create_user_login( | ||
user={'id': 1}, | ||
login={'unique_id': unique_id} | ||
) | ||
|
||
self.assertIsInstance(response, Login) | ||
self.assertTrue(hasattr(response, 'id')) | ||
self.assertTrue(hasattr(response, 'unique_id')) | ||
self.assertEqual(response.id, 123) | ||
self.assertEqual(response.unique_id, 112233) | ||
self.assertEqual(response.id, 101) | ||
self.assertEqual(response.unique_id, unique_id) | ||
|
||
def test_create_user_login_fail_on_user_id(self, m): | ||
with self.assertRaises(RequiredFieldMissing): | ||
self.account.create_user_login(user={}, login={}) | ||
|
||
def test_create_user_login_fail_on_login_unique_id(self, m): | ||
with self.assertRaises(RequiredFieldMissing): | ||
self.account.create_user_login(user={'id': 123}, login={}) | ||
self.account.create_user_login(user={'id': 1}, login={}) | ||
|
||
# get_department_level_participation_data_with_given_term() | ||
def test_get_department_level_participation_data_with_given_term(self, m): | ||
|
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 |
---|---|---|
|
@@ -17,13 +17,14 @@ def setUp(self): | |
|
||
with requests_mock.Mocker() as m: | ||
register_uris({ | ||
'account': ['get_by_id', 'create_user_login'] | ||
'account': ['get_by_id'], | ||
'login': ['create_user_login'] | ||
}, m) | ||
|
||
self.account = self.canvas.get_account(1) | ||
self.login = self.account.create_user_login( | ||
user={"id": 123}, | ||
login={"unique_id": 112233} | ||
user={'id': 1}, | ||
login={'unique_id': '[email protected]'} | ||
) | ||
|
||
# delete() | ||
|
@@ -34,16 +35,16 @@ def test_delete_user_login(self, m): | |
|
||
self.assertIsInstance(deleted_user_login, Login) | ||
self.assertTrue(hasattr(deleted_user_login, 'unique_id')) | ||
self.assertEqual(deleted_user_login.unique_id, 112233) | ||
self.assertEqual(deleted_user_login.unique_id, '[email protected]') | ||
|
||
# edit() | ||
def test_edit_user_login(self, m): | ||
register_uris({'login': ['edit_user_login']}, m) | ||
|
||
unique_id = 112233 | ||
unique_id = '[email protected]' | ||
edited_user_login = self.login.edit( | ||
user={"id": 123}, | ||
login={"unique_id": unique_id}, | ||
user={'id': 1}, | ||
login={'unique_id': unique_id}, | ||
) | ||
|
||
self.assertIsInstance(edited_user_login, Login) | ||
|