def test_load_default_events_file(self): """ Check that the events file is valid. """ path = os.path.join( MODULE_PATH, 'static', 'events', 'events.json') definitions = EventsDefinition(path=path) definitions.load() self.assertIsNotEmpty(definitions.getAllEventDefinitions()) self.assertIsNotEmpty(definitions.getAllEventGroupDefinitions())
def makeEventsDefinition(self, configuration_file=None, content=None, load=True, ): """Creates an EventHandler.""" if configuration_file is None: if content is None: content = u'' configuration_file = StringIO(content) config = EventsDefinition(file=configuration_file) if load: config.load() return config