Beispiel #1
0
    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))
Beispiel #2
0
 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')
Beispiel #3
0
 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')