Пример #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),
     )
Пример #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))
Пример #3
0
 def make_lock(self, objid):
     return dblocks.DatabaseXactLock(objid, mode=self.mode)