init commit with repo structure and basic files
This commit is contained in:
parent
41ad34550b
commit
3865dcc402
13 changed files with 393 additions and 0 deletions
25
tests/fixtures.py
Normal file
25
tests/fixtures.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import os
|
||||
from typing import Callable
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def current_dir(request) -> str:
|
||||
return os.path.dirname(request.module.__file__)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def get_test_image(current_dir) -> Callable[[str], bytes]:
|
||||
def f(name):
|
||||
return open(os.path.join(current_dir, "test_images", name), "rb").read()
|
||||
|
||||
return f
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def save_test_image(current_dir) -> Callable[[str, bytes], None]:
|
||||
def f(name: str, data: bytes):
|
||||
open(os.path.join(current_dir, "test_images", name), "wb").write(data)
|
||||
|
||||
return f
|
||||
Loading…
Add table
Add a link
Reference in a new issue