def test_ItemSet_Set2ItemSetsAndCommit_BothItemSetsAreSet(self): itemset1 = ItemSet() itemset2 = ItemSet() tx = Transaction() itemset1.set("testkey1", "value1", tx=tx) itemset2.set("testkey2", "value2", tx=tx) tx.commit() self.assertEquals(itemset1.get("testkey1"), "value1") self.assertEquals(itemset2.get("testkey2"), "value2")
def test_ItemSet_SetPlusDeleteInDifferentItemSetsAndCommit_BothItemSetsAreUpdated(self): itemset1 = ItemSet() itemset2 = ItemSet({"testkey2" : "value2"}) tx = Transaction() itemset1.set("testkey1", "value1", tx=tx) itemset2.delete("testkey2", tx=tx) tx.commit() self.assertEquals(itemset1.get("testkey1"), "value1") with self.assertRaises(KeyError): itemset2.get("testkey2")
def test_ItemSet_SetPlusDeleteInDifferentItemSetsAndCommit_BothItemSetsAreUpdated( self): itemset1 = ItemSet() itemset2 = ItemSet({"testkey2": "value2"}) tx = Transaction() itemset1.set("testkey1", "value1", tx=tx) itemset2.delete("testkey2", tx=tx) tx.commit() self.assertEquals(itemset1.get("testkey1"), "value1") with self.assertRaises(KeyError): itemset2.get("testkey2")