def check(mime, expected): result = http.mime2tuple(mime) self.assertEqual(result, expected)
def enable_mime_type(self, mime_type, priority=0.5): type, sub = http.mime2tuple(mime_type) self._mime_types.setdefault(type, {})[sub] = min(1.0, float(priority))