def test_bake_png(self): with open(os.path.join(os.path.dirname(__file__), 'testfiles', 'public_domain_heart.png' )) as image: return_file = png_bakery.bake(image, json.dumps(test_assertion)) return_file.open('r') self.assertEqual(utils.check_image_type(return_file), 'PNG') return_file.close() return_file.open('r') self.assertEqual(png_bakery.unbake(return_file), json.dumps(test_assertion))
def test_detect_png_type(self): with open(os.path.join(os.path.dirname(__file__), 'testfiles', 'public_domain_heart.png' )) as image: self.assertEqual(utils.check_image_type(image), 'PNG')
def test_detect_svg_type(self): with open(os.path.join(os.path.dirname(__file__), 'testfiles', 'baked_example.svg' )) as image: self.assertEqual(utils.check_image_type(image), 'SVG')