def setUp(self): log.info('MainTest#setUp: start') # NOTE: I don't understand what weird pythonic bullshit # neccessitates this, but it is needed for using timeout # decorator self.__name__ = 'MainTest' # setup collector instance with enough options to be # able to successfully instantiate try: self.collector except: log.info('MainTest#setup: exception') self.collector = collector({ '__role': 'master', 'transport': 'zeromq', 'sock_dir': '/tmp', 'pki_dir': '/etc/salt/pki', 'metrics': { 'update_interval': self.UPDATE_INTERVAL, 'saved_path': '/tmp/salt_metrics.json', 'persistence': True, 'decorator': 'prometheus' } })
def setUp(self): log.info("MainTest#setUp: start") # NOTE: I don't understand what weird pythonic bullshit # neccessitates this, but it is needed for using timeout # decorator self.__name__ = "MainTest" # setup collector instance with enough options to be # able to successfully instantiate try: self.collector except: log.info("MainTest#setup: exception") self.collector = collector( { "__role": "master", "transport": "zeromq", "sock_dir": "/tmp", "pki_dir": "/etc/salt/pki", "metrics": { "update_interval": self.UPDATE_INTERVAL, "saved_path": "/tmp/salt_metrics.json", "persistence": True, "decorator": "prometheus", }, } )
def test_run(self): log.info('MainTest#test_run: start') self.collector.run()
def test_collector(self): '''Ensure collector is correct instance type ''' log.info('MainTest#test_collector: start') self.assertEqual(type(self.collector), saltmetrics.collectors.DecoratedMetricsCollector)
def test_run(self): log.info("MainTest#test_run: start") self.collector.run()
def test_collector(self): """Ensure collector is correct instance type """ log.info("MainTest#test_collector: start") self.assertEqual(type(self.collector), saltmetrics.collectors.DecoratedMetricsCollector)