def get_local_image(self, src): """\ returns the bytes of the image file on disk """ local_image = ImageUtils.store_image(None, self.link_hash, src, self.config) return local_image
def test_detail(self): image_detail = ImageUtils.get_image_dimensions(None, self.path) # test if we have an ImageDetails instance self.assertTrue(isinstance(image_detail, ImageDetails)) # test image_detail attribute for k, v in self.expected_results.items(): self.assertEqual(getattr(image_detail, k), v) # test image_detail get_ methode for k, v in self.expected_results.items(): attr = 'get_%s' % k self.assertEqual(getattr(image_detail, attr)(), v) # test image_detail set_ methode expected_results = { 'width': 10, 'height': 10, 'mime_type': 'PNG' } for k, v in expected_results.items(): attr = 'set_%s' % k getattr(image_detail, attr)(v) for k, v in expected_results.items(): attr = 'get_%s' % k self.assertEqual(getattr(image_detail, attr)(), v)
def test_detail(self): image_detail = ImageUtils.get_image_dimensions(None, self.path) # test if we have an ImageDetails instance self.assertTrue(isinstance(image_detail, ImageDetails)) # test image_detail attribute for k, v in self.expected_results.items(): self.assertEqual(getattr(image_detail, k), v) # test image_detail get_ methode for k, v in self.expected_results.items(): attr = "get_%s" % k self.assertEqual(getattr(image_detail, attr)(), v) # test image_detail set_ methode expected_results = {"width": 10, "height": 10, "mime_type": "PNG"} for k, v in expected_results.items(): attr = "set_%s" % k getattr(image_detail, attr)(v) for k, v in expected_results.items(): attr = "get_%s" % k self.assertEqual(getattr(image_detail, attr)(), v)
def test_utils_get_image_dimensions(self): image_detail = ImageUtils.get_image_dimensions(None, self.path) # test if we have an ImageDetails instance self.assertTrue(isinstance(image_detail, ImageDetails)) # test image_detail attribute for k, v in self.expected_results.items(): self.assertEqual(getattr(image_detail, k), v)
def get_local_image(self, src): """\ returns the bytes of the image file on disk """ return ImageUtils.store_image(self.fetcher, self.link_hash, src, self.config)