How to use the yoga.image.helpers.guess_image_format function in yoga

To help you get started, we’ve selected a few yoga examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wanadev / yoga / test / test_image_helpers.py View on Github external
def test_supported_image_format(self, image_path, expected_format):
        image_bytes = open(image_path, "rb").read()
        assert helpers.guess_image_format(image_bytes) == expected_format
github wanadev / yoga / test / test_image_helpers.py View on Github external
def test_unsuported_image_format(self):
        image_bytes = open("test/images/alpha.svg", "rb").read()
        with pytest.raises(ValueError):
            helpers.guess_image_format(image_bytes)