예제 #1
0
 def test__image_ext_content_type_known_type(self):
     """Image._image_ext_content_type() correct for known content type"""
     # exercise ---------------------
     content_type = Image._image_ext_content_type('.jpeg')
     # verify -----------------------
     expected = 'image/jpeg'
     actual = content_type
     msg = ("expected content type '%s', got '%s'" % (expected, actual))
     self.assertEqual(expected, actual, msg)
예제 #2
0
 def test__image_ext_content_type_known_type(self):
     """
     Image._image_ext_content_type() correct for known content type
     """
     # exercise ---------------------
     content_type = Image._image_ext_content_type('jPeG')
     # verify -----------------------
     expected = 'image/jpeg'
     actual = content_type
     msg = ("expected content type '%s', got '%s'" % (expected, actual))
     self.assertEqual(expected, actual, msg)
예제 #3
0
 def test__image_ext_content_type_raises_on_bad_ext(self):
     with self.assertRaises(ValueError):
         Image._image_ext_content_type('xj7')
예제 #4
0
 def test__image_ext_content_type_raises_on_bad_ext(self):
     with self.assertRaises(ValueError):
         Image._image_ext_content_type('xj7')
예제 #5
0
 def test__image_ext_content_type_raises_on_non_img_ext(self):
     with self.assertRaises(TypeError):
         Image._image_ext_content_type('.xml')