Minor refactoring for constant

Renames _part_handler_content_type to _PART_HANDLER_CONTENT_TYPE.
This commit is contained in:
Alessandro Pilotti 2014-03-03 22:29:14 +02:00
parent 7c53a6d0ae
commit f0d9274b4b
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
class UserDataPlugin(base.BasePlugin):
_part_handler_content_type = "text/part-handler"
_PART_HANDLER_CONTENT_TYPE = "text/part-handler"
_GZIP_MAGIC_NUMBER = '\x1f\x8b'
def execute(self, service, shared_data):
@ -99,7 +99,7 @@ class UserDataPlugin(base.BasePlugin):
LOG.debug("Executing userdata plugin: %s" %
user_data_plugin.__class__.__name__)
if content_type == self._part_handler_content_type:
if content_type == self._PART_HANDLER_CONTENT_TYPE:
new_user_handlers = user_data_plugin.process(part)
self._add_part_handlers(user_data_plugins,
user_handlers,

View File

@ -135,7 +135,7 @@ class UserDataPluginTest(unittest.TestCase):
mock_user_handlers.get.side_effect = [handler_func]
mock_user_data_plugins.get.side_effect = [user_data_plugin]
if content_type:
_content_type = self._userdata._part_handler_content_type
_content_type = self._userdata._PART_HANDLER_CONTENT_TYPE
mock_part.get_content_type.return_value = _content_type
else:
_content_type = 'other content type'