Example #1
0
 def testTransactionAbort(self):
     folder = self._getfolder()
     self.assertTrue(folder is not None)
     self.assertTrue(folder._p_jar is None)
     transaction.savepoint()
     self.assertTrue(folder._p_jar is not None)
     transaction.abort()
     del folder
     folder = self._getfolder()
     self.assertTrue(folder is None)
 def testTransactionAbort(self):
     folder = self._getfolder()
     self.assert_(folder is not None)
     self.assert_(folder._p_jar is None)
     transaction.savepoint()
     self.assert_(folder._p_jar is not None)
     transaction.abort()
     del folder
     folder = self._getfolder()
     self.assert_(folder is None)
Example #3
0
 def test_doPush(self):
     path = '%s/%s' % (self.fol1.getId(), self.doc1.getId())
     # Need a _p_jar in order to sync stuff.
     # Use the subtransaction hack.
     try:
         transaction.commit(1)  # get_ XXX
         # It hasn't been configured yet, so not much happens.
         # We should get empty messages back.
         msgs = self.zs_tool.doPush(path)
         self.assertEqual(msgs, [])
     finally:
         transaction.abort(1)
Example #4
0
 def test_doPush(self):
     # doPush() requires the "subtransaction hack" to avoid missing
     # _p_ attributes.
     transaction.commit(1)
     try:
         # Try pushing a Missing object, it should no longer be missing.
         missing = self.doc_missing.getId()
         self.failIf(missing in self.fol2.objectIds())
         msgs = self.zs_tool.doPush(missing)
         self.assertEqual(len(msgs), 1)
         self.failIf(msgs[0].status > 200)
         self.failUnless(missing in self.fol2.objectIds())
         # Try pushing an Extra object, this should be not found.
         extra = self.doc_extra.getId()
         self.failIf(extra in self.fol1.objectIds())
         msgs = self.zs_tool.doPush(extra)
         self.assertEqual(len(msgs), 1)
         self.assertEqual(msgs[0].status, 404)
     finally:
         transaction.abort(1)
Example #5
0
 def _abort(self):
     '''Aborts the transaction.'''
     transaction.abort()
Example #6
0
 def _abort(self):
     """Aborts the transaction."""
     transaction.abort()