]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Vinkesh/Deepak| Added doc and small refactoring
authorDeepak N <deepak.n@thoughtworks.com>
Tue, 19 Jul 2011 04:50:48 +0000 (10:20 +0530)
committerDeepak N <deepak.n@thoughtworks.com>
Tue, 19 Jul 2011 04:50:48 +0000 (10:20 +0530)
quantum/common/extensions.py
tests/unit/test_extensions.py

index 7d46726995317e0a984ecf81f8b6d551c7538fb8..1d9d38bbb827c64f1305483464badba6bc88ce8b 100644 (file)
@@ -369,7 +369,7 @@ class ExtensionManager(object):
         expected_methods = self._get_public_methods(interface)
         implemented_methods = self._get_public_methods(self.plugin.__class__)
         missing_methods = set(expected_methods) - set(implemented_methods)
-        return len(missing_methods) == 0
+        return not missing_methods
 
     def _get_public_methods(self, klass):
         return filter(lambda name: not(name.startswith("_")),
index d806469a01ba3537470a268eff7f32ee63af7182..591a494169660d3fbed953fd144b6c79c46f7c6a 100644 (file)
@@ -102,6 +102,10 @@ class StubPlugin(object):
 
 
 class ExtensionExpectingPluginInterface(StubExtension):
+    """
+    This extension expects plugin to implement all the methods defined
+    in PluginInterface
+    """
 
     def get_plugin_interface(self):
         return PluginInterface
@@ -122,6 +126,10 @@ class ExtensionManagerTest(unittest.TestCase):
     def test_invalid_extensions_are_not_registered(self):
 
         class InvalidExtension(object):
+            """
+            This Extension doesn't implement extension methods :
+            get_name, get_description, get_namespace and get_updated
+            """
             def get_alias(self):
                 return "invalid_extension"