def test_kwargs(self): a = SomethingElse() a.value = 9 self.stack.push(U.undo_set_params(self, value=3, value2=7)) self.stack.push(U.undo_set_params(self, value3=9)) self.assertEqual(self.value, 3) self.assertEqual(self.value2, 7) self.assertEqual(self.value3, 9) self.stack.undo() self.assertEqual(self.value, 3) self.assertEqual(self.value2, 7) self.assertEqual(self.value3, 14) self.stack.undo() self.assertEqual(self.value, 0) self.assertEqual(self.value2, 11) self.assertEqual(self.value3, 14)
def test_kwargs_merge(self): self.stack.push(U.undo_set_params(self, value=6, merge=True)) self.stack.push(U.undo_set_params(self, value=7, merge=True))