Commit 2e1d6d96 authored by Guido Trotter's avatar Guido Trotter
Browse files

Add a new LockSet unittest

This test checks the LockSet behaviour when an empty list is passed.
The current behaviour is expected, but since this is a corner case,
we're safer to keep it under a check, and if we need a different one
monitor that everything is as we expect it to be.

Reviewed-by: imsnah
parent 5f33b613
......@@ -403,6 +403,18 @@ class TestLockSet(unittest.TestCase):
self.assertRaises(AssertionError,, 'five')
def testEmptyAcquire(self):
# Acquire an empty list of locks...
self.assertEquals([]), set())
self.assertEquals(, set())
# New locks can still be addded
# "re-acquiring" is not an issue, since we had really acquired nothing
self.assertEquals([], shared=1), set())
self.assertEquals(, set())
# We haven't really acquired anything, so we cannot release
def _doLockSet(self, set, shared):
try:, shared=shared)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment