Example #1
0
 def test_transaction_failed_failure(self):
   def run():
     EntityX(a=1).put()
     raise Failure()
   with self.assertRaises(Failure):
     txn.transaction(run)
   self.assertEqual(0, EntityX.query().count())
Example #2
0
 def test_transaction_failed_failure(self):
   def run():
     EntityX(a=1).put()
     raise Failure()
   with self.assertRaises(Failure):
     txn.transaction(run)
   self.assertEqual(0, EntityX.query().count())
Example #3
0
    def test_transaction(self):
        def run():
            EntityX(a=1).put()
            return 2

        self.assertEqual(2, txn.transaction(run))
        self.assertEqual(1, EntityX.query().count())
Example #4
0
 def test_transaction(self):
   def run():
     EntityX(a=1).put()
     return 2
   self.assertEqual(2, txn.transaction(run))
   self.assertEqual(1, EntityX.query().count())