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