-
Couldn't load subscription status.
- Fork 79
Adding endpoint to retrieve list of person #2103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,15 @@ | |
|
|
||
|
|
||
| class StudyPersonHandlerTests(RESTHandlerTestCase): | ||
| def test_get_list(self): | ||
| exp = [{'name': 'LabDude', 'affiliation': 'knight lab'}, | ||
| {'name': 'empDude', 'affiliation': 'broad'}, | ||
| {'name': 'PIDude', 'affiliation': 'Wash U'}] | ||
| response = self.get('/api/v1/person', headers=self.headers) | ||
| self.assertEqual(response.code, 200) | ||
| obs = json_decode(response.body) | ||
| self.assertItemsEqual(obs, exp) | ||
|
|
||
| def test_exist(self): | ||
| exp = {'email': 'lab_dude@foo.bar', 'phone': '121-222-3333', | ||
| 'address': '123 lab street', 'id': 1} | ||
|
|
@@ -45,6 +54,11 @@ def test_get_invalid_query_string(self): | |
| headers=self.headers) | ||
| self.assertEqual(response.code, 400) | ||
|
|
||
| def test_get_invalid_query_string_2(self): | ||
| response = self.get('/api/v1/person?affiliation=knight%20lab', | ||
| headers=self.headers) | ||
| self.assertEqual(response.code, 400) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this will need to be updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope - the response code of a missing argument is 400 :-) I was basically replicating the behavior of that exception with less readable code xD There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
|
||
| def test_get_valid_extra_arguments(self): | ||
| exp = {'email': 'lab_dude@foo.bar', 'phone': '121-222-3333', | ||
| 'address': '123 lab street', 'id': 1} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a raise
MissingArgumentError?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Forgot about that one :)