#NEWLINE# def testLockAlreadyAcquired( self ) : #NEWLINE# #INDENT# 'Test attempt to acquire a lock that is already owned.' #NEWLINE# lock = self . _TryAcquire ( 'op' , 'andy' , release_lock = False ) #NEWLINE# self . _TryAcquire ( 'op' , 'andy' , expected_status = Lock . FAILED_TO_ACQUIRE_LOCK ) #NEWLINE# self . _TryAcquire ( 'op' , 'andy' , expected_status = Lock . FAILED_TO_ACQUIRE_LOCK ) #NEWLINE# self . _Release ( lock ) #NEWLINE# self . assertEqual ( lock . acquire_failures , 2 )