From 778a019129b919b4856fc54e2f9d58209685f159 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 7 Aug 2008 00:35:51 +0000 Subject: [PATCH] 70: Plugin.__repr__ now again returns 'module_name.class_name()' form; updated unit test --- ipalib/plugable.py | 2 +- ipalib/tests/test_plugable.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 9cf313fa2..a60105a47 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -91,7 +91,7 @@ class Plugin(object): """ Returns a fully qualified representation of the class. """ - return '%s.%s' % ( + return '%s.%s()' % ( self.__class__.__module__, self.__class__.__name__ ) diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index 578277871..f529f4c29 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -68,7 +68,7 @@ def test_Plugin(): api = 'the api instance' p = plugable.Plugin() assert read_only(p, 'name') == 'Plugin' - assert repr(p) == '%s.Plugin' % plugable.__name__ + assert repr(p) == '%s.Plugin()' % plugable.__name__ assert read_only(p, 'api') is None raises(AssertionError, p.finalize, None) p.finalize(api) @@ -79,7 +79,7 @@ def test_Plugin(): pass p = some_plugin() assert read_only(p, 'name') == 'some_plugin' - assert repr(p) == '%s.some_plugin' % __name__ + assert repr(p) == '%s.some_plugin()' % __name__ assert read_only(p, 'api') is None raises(AssertionError, p.finalize, None) p.finalize(api)