def testGetSiteIdRange(self):
     """Test case -  return default id ranges selected sites."""
     try:
         cfds = ConfigInfoDataSet(self.__verbose, self.__lfh)
         for siteId in self.__siteIdList:
             (lId, uId) = cfds.getDefaultIdRange(siteId=siteId)
             logger.info(" siteId %-30s lower %-12d upper %-12d", siteId,
                         lId, uId)
             (refLid, refUid) = self.__siteIdRanges[siteId]
             if siteId in self.__siteIdRanges:
                 self.assertEqual(lId, refLid)
                 self.assertEqual(uId, refUid)
     except Exception as e:  # pragma: no cover
         logger.exception("Failure in getting id range %s", str(e))
         self.fail()
Ejemplo n.º 2
0
 def printConfig(self, siteId):
     """Print the configuration options for the input site."""
     try:
         cfds = ConfigInfoDataSet(self.__verbose, self.__lfh)
         (lId, uId) = cfds.getDefaultIdRange(siteId=siteId)
         self.__lfh.write(
             " Default data set range for site %-30s lower %-12d upper %-12d \n"
             % (siteId, lId, uId))
         #
         dataSetIdL = cfds.getDataSetLocations(siteId)
         nDataSets = len(dataSetIdL)
         for ii, dataSetId in enumerate(sorted(dataSetIdL)):
             self.__lfh.write("    %-8d - %12s\n" % (ii, dataSetId))
         self.__lfh.write("  Total alternate data set locations = %d" %
                          nDataSets)
     except Exception as e:
         self.__lfh.write("printConfig failing for site %r - %r\n" %
                          (siteId, str(e)))
         traceback.print_exc(file=self.__lfh)