diff options
Diffstat (limited to 'ipalib/tests/test_plugable.py')
-rw-r--r-- | ipalib/tests/test_plugable.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index 605debe5..42453ed5 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -62,6 +62,18 @@ class test_ReadOnly(ClassChecker): def test_class(self): assert self.cls.__bases__ == (object,) assert callable(self.cls.__lock__) + assert callable(self.cls.__islocked__) + + def test_lock(self): + """ + Tests the `__lock__` and `__islocked__` methods. + """ + o = self.cls() + assert o.__islocked__() is False + o.__lock__() + assert o.__islocked__() is True + raises(AssertionError, o.__lock__) # Can only be locked once + assert o.__islocked__() is True # This should still be True def test_when_unlocked(self): """ |