def testIncrement(self):
        """Test increment() method."""
        m = mox.Mox()

        # Set up mocks
        shard_state = m.CreateMockAnything()
        counters_map = m.CreateMockAnything()
        shard_state.counters_map = counters_map
        counters = context._Counters(shard_state)

        # Record call
        counters_map.increment('test', 19)

        m.ReplayAll()
        try:  # test, verify
            counters.increment('test', 19)

            m.VerifyAll()
        finally:
            m.UnsetStubs()
  def testIncrement(self):
    """Test increment() method."""
    m = mox.Mox()

    # Set up mocks
    shard_state = m.CreateMockAnything()
    counters_map = m.CreateMockAnything()
    shard_state.counters_map = counters_map
    counters = context._Counters(shard_state)

    # Record call
    counters_map.increment('test', 19)

    m.ReplayAll()
    try:  # test, verify
      counters.increment('test', 19)

      m.VerifyAll()
    finally:
      m.UnsetStubs()
 def testFlush(self):
     """Test flush() method."""
     counters = context._Counters(None)
     counters.flush()
 def testFlush(self):
   """Test flush() method."""
   counters = context._Counters(None)
   counters.flush()