tests/test-lock.py
changeset 26474 431094a3b21f
parent 26473 5f94e64f182c
child 26498 e8564e04382d
equal deleted inserted replaced
26473:5f94e64f182c 26474:431094a3b21f
   167             childlock = childstate.makelock(parentlock=lockname)
   167             childlock = childstate.makelock(parentlock=lockname)
   168             childstate.assertacquirecalled(True)
   168             childstate.assertacquirecalled(True)
   169 
   169 
   170             childlock.release()
   170             childlock.release()
   171             childstate.assertreleasecalled(True)
   171             childstate.assertreleasecalled(True)
   172             childstate.assertpostreleasecalled(True)
   172             childstate.assertpostreleasecalled(False)
   173             childstate.assertlockexists(True)
   173             childstate.assertlockexists(True)
   174 
   174 
   175             parentstate.resetacquirefn()
   175             parentstate.resetacquirefn()
   176 
   176 
   177         parentstate.assertacquirecalled(True)
   177         parentstate.assertacquirecalled(True)
   206                 lock2 = state2.makelock(parentlock=lock1name)
   206                 lock2 = state2.makelock(parentlock=lock1name)
   207                 state2.assertacquirecalled(True)
   207                 state2.assertacquirecalled(True)
   208 
   208 
   209                 lock2.release()
   209                 lock2.release()
   210                 state2.assertreleasecalled(True)
   210                 state2.assertreleasecalled(True)
   211                 state2.assertpostreleasecalled(True)
   211                 state2.assertpostreleasecalled(False)
   212                 state2.assertlockexists(True)
   212                 state2.assertlockexists(True)
   213 
   213 
   214                 state1.resetacquirefn()
   214                 state1.resetacquirefn()
   215 
   215 
   216             state1.assertacquirecalled(True)
   216             state1.assertacquirecalled(True)
   217 
   217 
   218             lock1.release()
   218             lock1.release()
   219             state1.assertreleasecalled(True)
   219             state1.assertreleasecalled(True)
   220             state1.assertpostreleasecalled(True)
   220             state1.assertpostreleasecalled(False)
   221             state1.assertlockexists(True)
   221             state1.assertlockexists(True)
   222 
   222 
   223         lock0.release()
   223         lock0.release()
   224 
   224 
   225     def testinheritlockfork(self):
   225     def testinheritlockfork(self):
   243             childstate.assertlockexists(True)
   243             childstate.assertlockexists(True)
   244 
   244 
   245             # release the child lock
   245             # release the child lock
   246             childlock.release()
   246             childlock.release()
   247             childstate.assertreleasecalled(True)
   247             childstate.assertreleasecalled(True)
   248             childstate.assertpostreleasecalled(True)
   248             childstate.assertpostreleasecalled(False)
   249             childstate.assertlockexists(True)
   249             childstate.assertlockexists(True)
   250 
   250 
   251         parentlock.release()
   251         parentlock.release()
   252 
   252 
   253 if __name__ == '__main__':
   253 if __name__ == '__main__':