Exemple #1
0
 def test_rollback(self):
     'VersionedStorage "rollback" method'
     d = VersionedStorage()
     d['a'] = 1
     d._commit()
     d['b'] = 2
     self.assertEqual(d.as_dict(), {'a': 1, 'b': 2})
     d._rollback()
     self.assertEqual(d.as_dict(), {'a': 1})
     self.assertEqual(d._VersionedStorage__stack, [{}])
Exemple #2
0
 def test_rollback(self):
     'VersionedStorage "rollback" method'
     d = VersionedStorage()
     d['a'] = 1
     d._commit()
     d['b'] = 2
     self.assertEqual(d.as_dict(), {'a': 1, 'b': 2})
     d._rollback()
     self.assertEqual(d.as_dict(), {'a': 1})
     self.assertEqual(d._VersionedStorage__stack, [{}])
Exemple #3
0
 def test_rollback_empty(self):
     'VersionedStorage "rollback" method on empty dict'
     d = VersionedStorage()
     d._rollback()
     self.assertEqual(d._VersionedStorage__stack, [{}])
     self.assert_(not d._modified)
Exemple #4
0
 def test_rollback_empty(self):
     'VersionedStorage "rollback" method on empty dict'
     d = VersionedStorage()
     d._rollback()
     self.assertEqual(d._VersionedStorage__stack, [{}])
     self.assert_(not d._modified)