diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-21 19:34:32 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-21 19:34:32 -0700 |
commit | 9d091c98f1f1bf7bacf49e9eaaa18ba8bb1bfd70 (patch) | |
tree | d8cf4dc86356ca8a13d769845de73f5b8b1371c8 /tests/test_ipalib/test_plugable.py | |
parent | 4390523b7f854cefcb91843e1df3ca7575d43fea (diff) | |
download | freeipa-9d091c98f1f1bf7bacf49e9eaaa18ba8bb1bfd70.tar.gz freeipa-9d091c98f1f1bf7bacf49e9eaaa18ba8bb1bfd70.tar.xz freeipa-9d091c98f1f1bf7bacf49e9eaaa18ba8bb1bfd70.zip |
Plugin.__init__() now checks that subclass hasn't defined attributes that conflict with the logger methods; added corresponding unit test
Diffstat (limited to 'tests/test_ipalib/test_plugable.py')
-rw-r--r-- | tests/test_ipalib/test_plugable.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_plugable.py b/tests/test_ipalib/test_plugable.py index b381675b6..b05943235 100644 --- a/tests/test_ipalib/test_plugable.py +++ b/tests/test_ipalib/test_plugable.py @@ -337,6 +337,14 @@ class test_Plugin(ClassChecker): assert o.doc is None assert o.summary == '<%s>' % o.fullname + # Test that Plugin makes sure the subclass hasn't defined attributes + # whose names conflict with the logger methods set in Plugin.__init__(): + class check(self.cls): + info = 'whatever' + e = raises(StandardError, check) + assert str(e) == \ + "check.info attribute ('whatever') conflicts with Plugin logger" + def test_implements(self): """ Test the `ipalib.plugable.Plugin.implements` classmethod. |