-
Notifications
You must be signed in to change notification settings - Fork 3
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 #62 from QuanMPhm/59/institute_domains
Allow a PI's institution name to be search with subdomains
- Loading branch information
Showing
3 changed files
with
27 additions
and
35 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 |
---|---|---|
|
@@ -229,34 +229,32 @@ def test_get_pi_institution(self): | |
"bu.edu": "Boston University", | ||
"bentley.edu": "Bentley", | ||
"mclean.harvard.edu": "McLean Hospital", | ||
"northeastern.edu": "Northeastern University", | ||
"childrens.harvard.edu": "Boston Children's Hospital", | ||
"meei.harvard.edu": "Massachusetts Eye & Ear", | ||
"dfci.harvard.edu": "Dana-Farber Cancer Institute", | ||
"northeastern.edu": "Northeastern University", | ||
"bwh.harvard.edu": "Brigham and Women's Hospital", | ||
"bidmc.harvard.edu": "Beth Israel Deaconess Medical Center", | ||
} | ||
|
||
self.assertEqual( | ||
process_report.get_institution_from_pi(institute_map, "[email protected]"), | ||
"Boston University", | ||
) | ||
self.assertEqual( | ||
process_report.get_institution_from_pi( | ||
institute_map, "[email protected]" | ||
), | ||
"McLean Hospital", | ||
) | ||
self.assertEqual( | ||
process_report.get_institution_from_pi(institute_map, "[email protected]"), | ||
"Harvard University", | ||
) | ||
self.assertEqual( | ||
process_report.get_institution_from_pi(institute_map, "fake"), "" | ||
) | ||
self.assertEqual( | ||
process_report.get_institution_from_pi( | ||
institute_map, "[email protected]" | ||
), | ||
"Northeastern University", | ||
) | ||
answers = { | ||
"[email protected]": "Boston University", | ||
"[email protected]": "McLean Hospital", | ||
"[email protected]": "Harvard University", | ||
"e@edu": "", | ||
"[email protected]": "Northeastern University", | ||
"[email protected]": "Harvard University", | ||
"[email protected]": "Boston Children's Hospital", | ||
"[email protected]": "Massachusetts Eye & Ear", | ||
"[email protected]": "", | ||
"[email protected]": "Brigham and Women's Hospital", | ||
"[email protected]": "Beth Israel Deaconess Medical Center", | ||
} | ||
|
||
for pi_email, answer in answers.items(): | ||
self.assertEqual( | ||
process_report.get_institution_from_pi(institute_map, pi_email), answer | ||
) | ||
|
||
|
||
class TestAlias(TestCase): | ||
|