def testClearAndInitializeCache(self): """ TestCachedIdAccess:testClearAndInitializeCache(self): - be sure that clearing and initializing the cache work """ cursor = self.connection.cursor() tidc = cia.IdCache(cursor) assert None != cia.productIdCache, 'But %s'%(cia.productIdCache) assert None != cia.productIdCount, 'But %s'%(cia.productIdCount) assert None != cia.uriIdCache, 'But %s'%(cia.uriIdCache) assert None != cia.uriIdCount, 'But %s'%(cia.uriIdCount) assert None != cia.osIdCache, 'But %s'%(cia.osIdCache) assert None != cia.osIdCount, 'But %s'%(cia.osIdCount) cia.clearCache() assert None == cia.productIdCache, 'But %s'%(cia.productIdCache) assert None == cia.productIdCount, 'But %s'%(cia.productIdCount) assert None == cia.uriIdCache, 'But %s'%(cia.uriIdCache) assert None == cia.uriIdCount, 'But %s'%(cia.uriIdCount) assert None == cia.osIdCache, 'But %s'%(cia.osIdCache) assert None == cia.osIdCount, 'But %s'%(cia.osIdCount) tidc.initializeCache() assert None != cia.productIdCache, 'But %s'%(cia.productIdCache) assert None != cia.productIdCount, 'But %s'%(cia.productIdCount) assert None != cia.uriIdCache, 'But %s'%(cia.uriIdCache) assert None != cia.uriIdCount, 'But %s'%(cia.uriIdCount) assert None != cia.osIdCache, 'But %s'%(cia.osIdCache) assert None != cia.osIdCount, 'But %s'%(cia.osIdCount)
def tearDown(self): global me sql = 'DELETE from %s' cursor = self.connection.cursor() cia.maxOsIdCacheLength = me.saveMaxOsIdCacheLength cia.maxProductIdCacheLength = me.saveMaxProductIdCacheLength cia.maxUriIdCacheLength = me.saveMaxUriIdCacheLength cia.clearCache() me.testDB.removeDB(me.config,me.logger)
def tearDown(self): global me self.testDB.removeDB(me.config,me.logger) cia.clearCache() self.connection.close()
def tearDown(self): self.testDB.removeDB(me.config,self.logger) socorro_cia.clearCache()