Ejemplo n.º 1
0
 def test_save_fetch(self):
     t = test_utils.GiveBackRevert('my task')
     s = self._get_storage()
     s.ensure_atom(t)
     s.save('my task', 2)
     self.assertEqual(2, s.get('my task'))
     self.assertRaises(exceptions.NotFound, s.get_revert_result, 'my task')
Ejemplo n.º 2
0
 def test_save_fail_fetch_revert(self):
     t = test_utils.GiveBackRevert('my task')
     s = self._get_storage()
     s.ensure_atom(t)
     s.set_atom_intention('my task', states.REVERT)
     a_failure = failure.Failure.from_exception(RuntimeError('Woot!'))
     s.save('my task', a_failure, state=states.REVERT_FAILURE)
     self.assertEqual(a_failure, s.get_revert_result('my task'))
Ejemplo n.º 3
0
 def test_save_fetch_revert(self):
     t = test_utils.GiveBackRevert('my task')
     s = self._get_storage()
     s.ensure_atom(t)
     s.set_atom_intention('my task', states.REVERT)
     s.save('my task', 2, state=states.REVERTED)
     self.assertRaises(exceptions.NotFound, s.get, 'my task')
     self.assertEqual(2, s.get_revert_result('my task'))