Ejemplo n.º 1
0
    def test_init_as_pickel(self):
        g = graphitesend.init()
        self.assertEqual(type(g), type(graphitesend.GraphiteClient()))

        for init_type in ['plaintext_tcp', 'plaintext', 'plain']:
            g = graphitesend.init(init_type=init_type, dryrun=True)
            self.assertEqual(type(g), type(graphitesend.GraphiteClient()))

        for init_type in ['pickle', 'pickle_tcp']:
            g = graphitesend.init(init_type=init_type, dryrun=True)
            self.assertEqual(type(g),
                             type(graphitesend.GraphitePickleClient()))
Ejemplo n.º 2
0
 def test_autoreconnect(self):
     g = graphitesend.GraphiteClient(autoreconnect=True)
     g.send("metric", 42)
     self.tearDown()
     with self.assertRaises(graphitesend.GraphiteSendException):
         g.send("metric", 2)
     self.setUp()
     g.send("metric", 3)
Ejemplo n.º 3
0
 def test_create_graphitesend_instance(self):
     g = graphitesend.init()
     expected_type = type(graphitesend.GraphiteClient())
     g_type = type(g)
     self.assertEqual(g_type, expected_type)