17 lines
293 B
Python
17 lines
293 B
Python
import base64
|
|
import io
|
|
|
|
import pytest
|
|
from PIL import Image
|
|
|
|
|
|
def make_png(width, height):
|
|
buf = io.BytesIO()
|
|
Image.new("RGB", (width, height), "white").save(buf, format="PNG")
|
|
return base64.b64encode(buf.getvalue()).decode()
|
|
|
|
|
|
@pytest.fixture
|
|
def fake_png():
|
|
return make_png
|