Ejemplo n.º 1
0
 def test_try_shared_variation(self):
     lock = dblocks.DatabaseXactLock(random_objid())
     self.assertThat(lock.TRY.SHARED, Equals(lock))
     self.assertDocTestMatches(
         "SELECT pg_try_advisory_xact_lock_shared(...)",
         capture_queries_while_holding_lock(lock.TRY.SHARED),
     )
Ejemplo n.º 2
0
 def test_plain_variation(self):
     lock = dblocks.DatabaseXactLock(random_objid())
     self.assertDocTestMatches("SELECT pg_advisory_xact_lock(...)",
                               capture_queries_while_holding_lock(lock))
Ejemplo n.º 3
0
 def make_lock(self, objid):
     return dblocks.DatabaseXactLock(objid, mode=self.mode)