Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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)