Ejemplo n.º 1
0
    def test_one_counter_multiple_events(self):
        test = TotalCounter("test", events=["test1", "test2"])
        register_counter(test)

        test.report_event("test1", "value", 1)
        test.report_event("test2", "value", 2)
        self.assertEquals(test.get_value().value, 3)

        unregister_counter(counter=test)
Ejemplo n.º 2
0
    def test_total_counter(self):
        test = TotalCounter("test")
        self.assertEquals(test.get_value().value, None)
        test.report_event("test", "value", 1)
        test.report_event("test", "value", 2)
        self.assertEquals(test.get_value().value, 3)

        test.clear(dump=False)
        test.report_event("test", "value", 1)
        self.assertEquals(test.get_value().value, 1)