def test_get_cairo_surface_bad_input(): with pytest.raises(images.LoadingError): images.get_cairo_surface(b'asdfasfdi3')
def test_get_cairo_surface(path_n_bytes_image): path, bytes_image = path_n_bytes_image surf_info = images.get_cairo_surface(bytes_image) assert isinstance(surf_info.surface, cairocffi.ImageSurface) assert path.split('.')[-1].lower() == surf_info.file_type
def test_get_cairo_surface(path_n_bytes_image): path, bytes_image = path_n_bytes_image surf_info = images.get_cairo_surface(bytes_image) assert isinstance(surf_info.surface, cairocffi.ImageSurface) assert path.split(".")[-1].lower() == surf_info.file_type
def test_get_cairo_surface_bad_input(): with pytest.raises(cairocffi.pixbuf.ImageLoadingError): images.get_cairo_surface(b"asdfasfdi3")