99
99
# Taking out a lock on a locked file should raise LockContention
100
100
self.assertRaises(errors.LockContention, lock.WriteLock, 'a-file')
103
103
"""If a file is read-locked, taking out a write lock should fail."""
104
104
a_lock = lock.ReadLock('a-file')
105
105
self.addCleanup(a_lock.unlock)
106
106
# Taking out a lock on a locked file should raise LockContention
107
107
self.assertRaises(errors.LockContention, lock.WriteLock, 'a-file')
110
117
"""If a file is write-locked, taking out a read lock should fail.
112
119
The file is exclusively owned by the write lock, so we shouldn't be