

def testBatchPutGet(self):
    self.node.shutdown()
    size = 60
    batch1 = [('1' * 20), ('2' * 20)]
    batch2 = [('3' * 20), ('4' * 20)]
    self.node = Store(self.dir_, size)
    self.assertEqual(self.node.put(batch1), batch1)
    self.assertEqual(self.node.put(batch2), batch2)
    self.assertEqual(len(self.node.legal_files), 2)
    gets = sorted([self.node.get() for _ in range(4)])
    res = list(batch1)
    _.extend(batch2)
    self.assertEqual(gets, res)
    self.node.put(('5' * 20))
    self.assertEqual(self.node.get(), ('5' * 20))
    self.node.put(('6' * 20))
    self.assertEqual(len(self.node.legal_files), 1)
    self.assertEqual(self.node.get(), ('6' * 20))
    self.assertEqual(self.node.get(), None)
    self.assertRaises(StoreNoSpaceForPut, (lambda : self.node.put(('7' * 100))))

dataset/ETHPy150Open chineking/cola/tests/test_mq_store.py Test.testBatchPutGet/VarMisuse@144/170 `res`->`_`