def testAppend(self): r1 = Results() r1.startBenchmark() for i in xrange(0, 5000): txn = random.choice(self.txnNames) id = r1.startTransaction(txn) assert id != None r1.stopTransaction(id, 1) ## FOR r1.stopBenchmark() print r1.show() # Append the time and then make sure they're the same r2 = Results() r2.append(r1) self.compareResults(r1, r2)
def testPickle(self): r = Results() r.startBenchmark() for i in xrange(0, 1000): txn = random.choice(self.txnNames) id = r.startTransaction(txn) assert id != None r.stopTransaction(id, 1) ## FOR # Serialize import pickle p = pickle.dumps(r, -1) assert p # Deserialize clone = pickle.loads(p) assert clone # Make sure the txn counts are equal self.compareResults(r, clone)