def query_name_and_phid_from_email(self, email): """Return a (username, phid) tuple based on the provided email. If an email does not correspond to a user then None is returned. :email: a strings of the user's email address :returns: a (username, phid) tuple """ user = phlcon_user.query_user_from_email(self._conduit, email) result = None if user: result = (user.userName, user.phid) return result
def query_name_and_phid_from_email(self, email): """Return a (username, phid) tuple based on the provided email. If an email does not correspond to a user then None is returned. :email: a strings of the user's email address :returns: a (username, phid) tuple """ user = phlcon_user.query_user_from_email(self._multi_conduit, email) result = None if user: result = (user.userName, user.phid) return result
def testAliceEmail(self): users = phlcon_user.query_users_from_emails( self.conduit, [self.test_email]) self.assertEqual(len(users), 1) self.assertEqual(users[0], self.test_user) user = phlcon_user.query_user_from_email(self.conduit, self.test_email) self.assertEqual(user.userName, self.test_user) phidUsers = phlcon_user.query_users_from_phids( self.conduit, [user.phid]) self.assertEqual(phidUsers[0].userName, self.test_user) phidUsernames = phlcon_user.query_usernames_from_phids( self.conduit, [user.phid]) self.assertEqual(phidUsernames[0], self.test_user)