Пример #1
0
 def testGetUserFromNoneRpxId(self):
     """Tests RpxBackend.get_user_by_rpx_id().
     
     Make sure it handles None and negative results.
     
     """
     try:
         RpxBackend.get_user_by_rpx_id(self.backend, None)
         self.assert_(False)
     except ValueError:
         pass
     
     self.assert_(RpxBackend.get_user_by_rpx_id(self.backend, "will not find") == None)
Пример #2
0
 def testGetUserFromRpxId(self):
     """Tests RpxBackend.get_user_by_rpx_id()."""
     
     user, auth_info = self.__create_normal_user__()
     
     self.assert_(user == RpxBackend.get_user_by_rpx_id(self.backend, auth_info.get_rpx_id()))
     
     RpxBackend.delete_user(self.backend, user)
Пример #3
0
 def testGetUserFromRpxIdWithInvalidModel(self):
     
     try:
         rpx_data = RpxData(key_name=RpxBackend.create_rpx_key(self.backend, "thisiskey"), user=None)
         self.assert_(False)
     except db.BadValueError:
         pass            
     
     self.assert_(RpxBackend.get_user_by_rpx_id(self.backend, "thisiskey") == None)
Пример #4
0
 def testCreateNewUser(self):
     """Tests RpxBackend.create_user().
     
     Creates a new normal user.
     
     """
     user, auth_info = self.__create_normal_user__()
     
     retreived_user = RpxBackend.get_user_by_rpx_id(self.backend, auth_info.get_rpx_id())
     
     self.assert_(retreived_user == user)        
     self.assert_(user.key() == retreived_user.key())
     
     RpxBackend.delete_user(self.backend, user)