def testThreadSafeCounter(self): counter = shard._ThreadSafeCounter() for i in xrange(5): self.assertEqual(counter.GetAndIncrement(), i)
def testSetUp(self): runners = [] counter = shard._ThreadSafeCounter() shard._SetUp(MockRunner, '0', runners, counter) self.assertEqual(len(runners), 1) self.assertEqual(runners[0].setups, 1)