From 58a3b1d0915f32326e9387bc4978c53a16e5f217 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 8 Aug 2008 21:28:56 +0000 Subject: 85: Added ReadOnly._lock() method to make class easier to use; updated subclasses and unit tests --- ipalib/tests/test_plugable.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ipalib/tests/test_plugable.py') diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index ad1645f1..af6ee0c9 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -139,6 +139,7 @@ def test_Plugin(): def test_ReadOnly(): obj = plugable.ReadOnly() + obj._lock() names = ['not_an_attribute', 'an_attribute'] for name in names: no_set(obj, name) @@ -146,7 +147,8 @@ def test_ReadOnly(): class some_ro_class(plugable.ReadOnly): def __init__(self): - object.__setattr__(self, 'an_attribute', 'Hello world!') + self.an_attribute = 'Hello world!' + self._lock() obj = some_ro_class() for name in names: no_set(obj, name) -- cgit