def __init__(self, message, parameters, config): super(SummaryReplayer, self).__init__(message, parameters) self._config = config # Initialize the project information self.project = projects.OIMProjects( url=self._config['OIM_URLs'].get('projects')) # Initialize the OIM Topology information self.topology = OIMTopology.OIMTopology( url=self._config['OIM_URLs'].get('oimtopology')) # Initialize the OIM VO information self.oimvoinfo = voinfo.OIMVOInfo( url=self._config['OIM_URLs'].get('voinfo')) # Initiatlize name corrections self.corrections = [] for c in self._config.get('Corrections', []): self.corrections.append( Corrections(uri=self._config['ElasticSearch'].get( 'uri', 'http://localhost:9200'), index=c['index'], doc_type=c['doc_type'], match_fields=c['match_fields'], source_field=c['source_field'], dest_field=c['dest_field'], regex=c.get('regex', False)))
def test_caching(self): """Test to make sure that we can read from cache and that lock is released after reading file""" testclass = OIMTopology.OIMTopology() self.assertTrue(testclass.have_info) self.assertFalse(testclass.cachelock.is_locked) if os.path.exists(testclass.lockfile): os.unlink(testclass.lockfile) return True
def setUpClass(cls): cls.topology = OIMTopology.OIMTopology()
def setUpClass(cls): # Read in the test config file configuration = "tests/gracc-request-test.toml" with open(configuration, 'r') as config_file: config = toml.loads(config_file.read()) cls.topology = OIMTopology.OIMTopology(config['OIM_URLs'].get('oimtopology'))