Пример #1
0
 def test_failed_error_metric_publish(self, mock_publish):
     c = Collector(self.config_object(), [])
     self.assertFalse(c.can_publish_metric())
     with patch.object(c, "log"):
         try:
             c.publish("metric", "baz")
         except DiamondException:
             pass
     self.assertEquals(len(mock_publish.mock_calls), 0)
Пример #2
0
 def test_failed_error_metric_publish(self, mock_publish):
     c = Collector(self.config_object(), [])
     self.assertFalse(c.can_publish_metric())
     with patch.object(c, 'log'):
         try:
             c.publish('metric', "baz")
         except DiamondException:
             pass
     self.assertEquals(len(mock_publish.mock_calls), 0)
Пример #3
0
    def test_can_publish_metric(self):
        c = Collector(self.config_object(), [])
        self.assertFalse(c.can_publish_metric())

        c._socket = "socket"
        self.assertTrue(c.can_publish_metric())
Пример #4
0
    def test_can_publish_metric(self):
        c = Collector(self.config_object(), [])
        self.assertFalse(c.can_publish_metric())

        c._socket = "socket"
        self.assertTrue(c.can_publish_metric())