Exemplo n.º 1
0
    def test_get(self):
        local_entity = PdbModel.get(self.setup_key, _storage='local')
        memcache_entity = PdbModel.get(self.setup_key, _storage='memcache')
        db_entity = PdbModel.get(self.setup_key, _storage='datastore')

        self.assertEqual(local_entity.name, self.setup_name)
        self.assertEqual(memcache_entity.name, self.setup_name)
        self.assertEqual(db_entity.name, self.setup_name)
Exemplo n.º 2
0
 def test_get(self):  
   local_entity = PdbModel.get(self.setup_key,_storage='local')
   memcache_entity = PdbModel.get(self.setup_key,_storage='memcache')
   db_entity = PdbModel.get(self.setup_key,_storage='datastore')
   
   self.assertEqual(local_entity.name,self.setup_name)
   self.assertEqual(memcache_entity.name,self.setup_name)
   self.assertEqual(db_entity.name,self.setup_name)
Exemplo n.º 3
0
    def test_put(self):
        model = PdbModel(name='put_test')
        key = model.put(_storage=['local', 'memcache', 'datastore'])

        local_entity = PdbModel.get(key, _storage='local')
        memcache_entity = PdbModel.get(key, _storage='memcache')
        db_entity = PdbModel.get(key, _storage='datastore')

        self.assertEqual(local_entity.name, 'put_test')
        self.assertEqual(memcache_entity.name, 'put_test')
        self.assertEqual(db_entity.name, 'put_test')
Exemplo n.º 4
0
 def test_delete(self):
   model = PdbModel.get(self.setup_key,_storage=['local','memcache','datastore'])
   model.delete(_storage=['local','memcache','datastore'])
   
   local_entity = PdbModel.get(self.setup_key,_storage='local')
   memcache_entity = PdbModel.get(self.setup_key,_storage='memcache')
   db_entity = PdbModel.get(self.setup_key,_storage='datastore')
   
   self.assertEqual(local_entity , None)
   self.assertEqual(memcache_entity , None)
   self.assertEqual(db_entity , None)
Exemplo n.º 5
0
 def test_put(self):
   model = PdbModel(name='put_test')
   key = model.put(_storage=['local','memcache','datastore'])
   
   local_entity = PdbModel.get(key,_storage='local')
   memcache_entity = PdbModel.get(key,_storage='memcache')
   db_entity = PdbModel.get(key,_storage='datastore')
   
   self.assertEqual(local_entity.name,'put_test')
   self.assertEqual(memcache_entity.name,'put_test')
   self.assertEqual(db_entity.name,'put_test')                
Exemplo n.º 6
0
    def test_delete(self):
        model = PdbModel.get(self.setup_key,
                             _storage=['local', 'memcache', 'datastore'])
        model.delete(_storage=['local', 'memcache', 'datastore'])

        local_entity = PdbModel.get(self.setup_key, _storage='local')
        memcache_entity = PdbModel.get(self.setup_key, _storage='memcache')
        db_entity = PdbModel.get(self.setup_key, _storage='datastore')

        self.assertEqual(local_entity, None)
        self.assertEqual(memcache_entity, None)
        self.assertEqual(db_entity, None)