Commits

Mike Orr committed f579886

Fix webob dependencies in mimetypes: move import to module, disable tests.

  • Participants
  • Parent commits 3edb210

Comments (0)

Files changed (2)

File tests/test_mimetypes.py

+'''
+TEMPORARILY DISABLE TESTS BECAUSE THEY DEPEND ON WEBOB.
+
 from webhelpers.mimehelper import MIMETypes
 from util import test_environ
 
     environ['HTTP_ACCEPT'] = '*/*'
     m = MIMETypes(environ)
     assert m.mimetype('application/xml') == 'application/xml'
+'''

File webhelpers/mimehelper.py

-"""MIMEType helpers"""
+"""MIMEType helpers
+
+These helpers depend on the WebOb package.
+"""
 import mimetypes
-import webob
 
 class MIMETypes(object):
     """MIMETypes registration mapping
         
         """
 
+        import webob
+
         if content_type in MIMETypes.aliases:
             content_type = MIMETypes.aliases[content_type]
         path = self.env['PATH_INFO']
         elif guess_from_url is None and content_type in possible_from_accept_header:
             return self._set_responce_conetent_type(content_type)
         else:
-            return False
+            return False