diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-24 23:29:15 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-24 23:29:15 +0000 |
commit | be2e323bbf3f036777acd6e5e16e03f9e66b2ee8 (patch) | |
tree | 062cce34ef29b0fad96896a2afb39a4ae0b87193 /ipalib/tests | |
parent | c3b09b2116dcbab36098f11c6b3684a6d0e47c08 (diff) | |
download | freeipa-be2e323bbf3f036777acd6e5e16e03f9e66b2ee8.tar.gz freeipa-be2e323bbf3f036777acd6e5e16e03f9e66b2ee8.tar.xz freeipa-be2e323bbf3f036777acd6e5e16e03f9e66b2ee8.zip |
353: The Object.parms instance attribute is now created in Object.set_api() instead of in Object.__init__()
Diffstat (limited to 'ipalib/tests')
-rw-r--r-- | ipalib/tests/test_frontend.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ipalib/tests/test_frontend.py b/ipalib/tests/test_frontend.py index 0109934de..f6bca9b9d 100644 --- a/ipalib/tests/test_frontend.py +++ b/ipalib/tests/test_frontend.py @@ -754,7 +754,7 @@ class test_Command(ClassChecker): class test_Object(ClassChecker): """ - Tests the `frontend.Object` class. + Test the `frontend.Object` class. """ _cls = frontend.Object @@ -762,19 +762,22 @@ class test_Object(ClassChecker): assert self.cls.__bases__ == (plugable.Plugin,) assert self.cls.methods is None assert self.cls.properties is None + assert self.cls.params is None assert self.cls.takes_params == tuple() def test_init(self): """ - Tests the `frontend.Object.__init__` method. + Test the `frontend.Object.__init__` method. """ o = self.cls() assert o.methods is None assert o.properties is None + assert o.params is None + assert o.properties is None def test_set_api(self): """ - Tests the `frontend.Object.set_api` method. + Test the `frontend.Object.set_api` method. """ # Setup for test: class DummyAttribute(object): @@ -834,16 +837,17 @@ class test_Object(ClassChecker): assert attr.attr_name == attr_name assert attr.name == attr_name - def test_params(self): - """ - Test the ``frontend.Object.params`` instance attribute. - """ - ns = self.cls().params + # Test params instance attribute + o = self.cls() + o.set_api(api) + ns = o.params assert type(ns) is plugable.NameSpace assert len(ns) == 0 class example(self.cls): takes_params = ('banana', 'apple') - ns = example().params + o = example() + o.set_api(api) + ns = o.params assert type(ns) is plugable.NameSpace assert len(ns) == 2, repr(ns) assert list(ns) == ['banana', 'apple'] |