class TestExampleCollector(CollectorTestCase): def setUp(self): config = get_collector_config('ExampleCollector', {'interval': 10}) self.collector = ExampleCollector(config, None) @patch.object(Collector, 'publish') def test(self, publish_mock): self.collector.collect() metrics = {'my.example.metric': 42} self.setDocExample(self.collector.__class__.__name__, metrics) self.assertPublishedMany(publish_mock, metrics)
class TestExampleCollector(CollectorTestCase): def setUp(self): config = get_collector_config('ExampleCollector', { 'interval' : 10 }) self.collector = ExampleCollector(config, None) @patch.object(Collector, 'publish') def test(self, publish_mock): self.collector.collect() self.assertPublishedMany(publish_mock, { 'my.example.metric' : 42 })
class TestExampleCollector(CollectorTestCase): def setUp(self): config = get_collector_config('ExampleCollector', { 'interval': 10 }) self.collector = ExampleCollector(config, None) @patch.object(Collector, 'publish') def test(self, publish_mock): self.collector.collect() metrics = { 'my.example.metric': 42 } self.setDocExample(collector=self.collector.__class__.__name__, metrics=metrics, defaultpath=self.collector.config['path']) self.assertPublishedMany(publish_mock, metrics)
def setUp(self): config = get_collector_config('ExampleCollector', { 'interval' : 10 }) self.collector = ExampleCollector(config, None)
def setUp(self): config = get_collector_config('ExampleCollector', {'interval': 10}) self.collector = ExampleCollector(config, None)