Added a test with uppercase UID

Modified the script test to expect an empty dictionary now, instead of raising an error
This commit is contained in:
mike cullerton 2021-07-22 10:47:25 -04:00
parent 8df1145471
commit 6b51fc7c06
2 changed files with 7 additions and 2 deletions

View File

@ -45,8 +45,8 @@ class TestLdapLookupScript(BaseTest):
}
script = Ldap()
with(self.assertRaises(ApiError)):
user_details = script.do_task(task, workflow.study_id, workflow.id, "PIComputingID")
user_details = script.do_task(task, workflow.study_id, workflow.id, "PIComputingID")
self.assertEqual({}, user_details)
def test_get_current_user_details(self):
self.load_example_data()

View File

@ -31,3 +31,8 @@ class TestLdapService(BaseTest):
self.assertFalse(True, "An API error should be raised.")
except ApiError as ae:
self.assertEqual("missing_ldap_record", ae.code)
def test_get_user_with_caps(self):
user_info = LdapService.user_info("LB3DP")
self.assertIsNotNone(user_info)
self.assertEqual("lb3dp", user_info.uid)