70: Plugin.__repr__ now again returns 'module_name.class_name()' form; updated unit test

This commit is contained in:
Jason Gerard DeRose 2008-08-07 00:35:51 +00:00
parent 19dbd57141
commit 778a019129
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ class Plugin(object):
""" """
Returns a fully qualified <module><name> representation of the class. Returns a fully qualified <module><name> representation of the class.
""" """
return '%s.%s' % ( return '%s.%s()' % (
self.__class__.__module__, self.__class__.__module__,
self.__class__.__name__ self.__class__.__name__
) )

View File

@ -68,7 +68,7 @@ def test_Plugin():
api = 'the api instance' api = 'the api instance'
p = plugable.Plugin() p = plugable.Plugin()
assert read_only(p, 'name') == '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 assert read_only(p, 'api') is None
raises(AssertionError, p.finalize, None) raises(AssertionError, p.finalize, None)
p.finalize(api) p.finalize(api)
@ -79,7 +79,7 @@ def test_Plugin():
pass pass
p = some_plugin() p = some_plugin()
assert read_only(p, 'name') == '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 assert read_only(p, 'api') is None
raises(AssertionError, p.finalize, None) raises(AssertionError, p.finalize, None)
p.finalize(api) p.finalize(api)