Add PathField class for storing pathlib objects

Add tests for pathfield class
Add database fixture for generating test databases
This commit is contained in:
2021-11-24 17:13:41 -05:00
parent 5499d282eb
commit adab90736c
3 changed files with 160 additions and 0 deletions

22
tests/fixtures.py Normal file
View File

@@ -0,0 +1,22 @@
import uuid
import peewee
import pytest
@pytest.fixture(scope="function")
def fakedb(tmp_path):
"""Create a temporary pho-database (fakedb) for testing fields"""
sqlite = peewee.SqliteDatabase(
tmp_path / f"{uuid.uuid4()}.db",
pragmas={
"journal_mode": "wal",
"cache_size": -1 * 64000,
"foreign_keys": 1,
"ignore_check_constraints": 0,
"synchronous": 0,
},
)
yield sqlite