Ejemplo n.º 1
0
    def test_get_counter(self):
        ctx = get_execution_context()
        counters = ctx.get_counters()
        c = counters.get_counter("test_group", "test")
        self.assertEqual("test", c.get_name())
        self.assertEqual(0, c.get_value())

        c.increment(1)
        self.assertEqual(1, c.get_value())
Ejemplo n.º 2
0
 def test_single_counters(self):
     ctx1 = get_execution_context()
     counters = ctx1.get_counters()
     counters.get_counter("test_group", "test")
     self.assertEqual(1, counters.size())
     
     ctx2 = ExecutionContext()
     counters2 = ctx2.get_counters()
     counters2.get_counter("test_group2", "test2")
     self.assertEqual(2, counters2.size())