def __fetchProvenance(self):
     """Test case for fetching a provenance dictionary content."""
     try:
         provU = ProvenanceProvider(self.__cfgOb, self.__cachePath)
         pD = provU.fetch()
         return pD[self.__provKeyName] if self.__provKeyName in pD else {}
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
Example #2
0
 def __fetchProvenance(self):
     """Test case for fetching a provenance dictionary content."""
     try:
         provKeyName = "rcsb_entity_sequence_cluster_prov"
         provU = ProvenanceProvider(self.__cfgOb, self.__cachePath, useCache=True)
         pD = provU.fetch()
         return pD[provKeyName] if provKeyName in pD else {}
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
 def testPrefetchProvenance(self):
     """Test case for pre-fetching cached provenance dictionary content."""
     try:
         provU = ProvenanceProvider(self.__cfgOb, self.__cachePath)
         pD = provU.fetch()
         logger.debug("pD keys %r", list(pD.keys()))
         self.assertGreaterEqual(len(pD.keys()), 1)
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
 def testStore(self):
     """Test case for storing a provenance dictionary content."""
     try:
         provU = ProvenanceProvider(self.__cfgOb,
                                    self.__cachePath,
                                    useCache=False)
         pD = {self.__provKeyName: self.__provInfoL}
         ok = provU.store(pD)
         #
         self.assertTrue(ok)
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
Example #5
0
 def __fetchProvenance(self):
     """Fetching a provenance dictionary content."""
     try:
         provKeyName = self.__cfgOb.get(
             "PROVENANCE_KEY_NAME",
             sectionName=self.__sectionCluster,
             default="rcsb_entity_sequence_cluster_prov")
         provU = ProvenanceProvider(self.__cfgOb,
                                    self.__cachePath,
                                    useCache=True)
         pD = provU.fetch()
         return pD[provKeyName] if provKeyName in pD else {}
     except Exception as e:
         logger.exception("Failing with %s", str(e))
     return {}
 def testUpdate(self):
     """Test case for updating a provenance dictionary content."""
     try:
         provU = ProvenanceProvider(self.__cfgOb,
                                    self.__cachePath,
                                    useCache=False)
         pD = {self.__provKeyName: self.__provInfoL}
         ok = provU.store(pD)
         self.assertTrue(ok)
         #
         ok = provU.update(pD)
         self.assertTrue(ok)
         #
         fD = provU.fetch()
         self.assertTrue(self.__provKeyName in fD)
         self.assertDictEqual(pD, fD)
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()