-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ nose==1.3.4 | |
requests==2.4.3 | ||
beautifulsoup4==4.4.1 | ||
html5lib==0.999 | ||
nameparser==0.4.0 |
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 |
---|---|---|
|
@@ -15,3 +15,42 @@ def test_lastname_search(self): | |
person = self.dir.detail_search({'last_name':'Domingoes'})['result_data'] | ||
self.assertEquals(len(person), 1) | ||
self.assertEquals(person[0]['result_data'][0]['detail_name'], "ADAM W DOMINGOES") | ||
|
||
def test_lastname_search_standardized(self): | ||
person = self.dir.detail_search({'last_name':'Domingoes'}, standardize=True)['result_data'] | ||
self.assertEquals(len(person), 1) | ||
self.assertEquals(person[0]['result_data'][0]['detail_name'], "Adam W Domingoes") | ||
|
||
def test_person_id(self): | ||
# Alex Wissmann's person id | ||
details = self.dir.person_details('041cd6e739387e24db2483785b87b082')['result_data'] | ||
self.assertEquals(details[0]['detail_name'], "ADAM W DOMINGOES") | ||
|
||
def test_person_id_standardized(self): | ||
# Alex Wissmann's person id | ||
details = self.dir.person_details('041cd6e739387e24db2483785b87b082', True)['result_data'] | ||
self.assertEquals(details[0]['detail_name'], "Adam W Domingoes") | ||
|
||
def test_faculty_name_not_standardized(self): | ||
fac = self.dir.search({'first_name': 'kostas'}) | ||
self.assertEquals(fac['result_data'][0]['list_name'], "DANIILIDIS, KONSTANTINOS ") | ||
|
||
def test_faculty_name_standardized(self): | ||
fac = self.dir.search({'first_name': 'kostas'}, standardize=True) | ||
self.assertEquals(fac['result_data'][0]['list_name'], "Konstantinos Daniilidis") | ||
|
||
def test_email_not_standardized(self): | ||
email = self.dir.search({'first_name': 'amy', 'last_name': 'gallagher'}) | ||
self.assertEqual(email['result_data'][0]['list_email'], '[email protected]') | ||
|
||
def test_email_standardized(self): | ||
email = self.dir.search({'first_name': 'amy', 'last_name': 'gallagher'}, standardize=True) | ||
self.assertEqual(email['result_data'][0]['list_email'], '[email protected]') | ||
|
||
def test_afl_not_standardized(self): | ||
afl = self.dir.search({'first_name': 'kostas'}) | ||
self.assertEqual(afl['result_data'][0]['list_affiliation'], 'Faculty - ASSOC PROFESSOR') | ||
|
||
def test_afl_standardized(self): | ||
afl = self.dir.search({'first_name': 'kostas'}, standardize=True) | ||
self.assertEqual(afl['result_data'][0]['list_affiliation'], 'ASSOC PROFESSOR') |