kiwi/tests/conftest.py
pyr0ball cfe56c3058
Some checks are pending
CI / Backend (Python) (push) Waiting to run
CI / Frontend (Vue) (push) Waiting to run
Mirror / mirror (push) Waiting to run
fix(tests): move store_with_profiles fixture to conftest.py so cross-module tests find it
2026-07-07 22:00:54 -07:00

26 lines
938 B
Python

"""Shared pytest fixtures for kiwi test suite."""
import json
import pytest
from app.db.store import Store
@pytest.fixture
def store_with_profiles(tmp_path):
db_path = tmp_path / "test.db"
store = Store(db_path)
store.conn.execute("""
INSERT INTO ingredient_profiles
(name, elements, fat_pct, moisture_pct, glutamate_mg, binding_score,
sodium_mg_per_100g, is_fermented, texture_profile)
VALUES (?,?,?,?,?,?,?,?,?)
""", ("butter", json.dumps(["Richness"]), 81.0, 16.0, 0.1, 0, 11.0, 0, "creamy"))
store.conn.execute("""
INSERT INTO ingredient_profiles
(name, elements, fat_pct, moisture_pct, glutamate_mg, binding_score,
sodium_mg_per_100g, is_fermented, texture_profile)
VALUES (?,?,?,?,?,?,?,?,?)
""", ("parmesan", json.dumps(["Depth", "Seasoning"]), 29.0, 29.0, 1.2, 1, 1600.0, 0, "neutral"))
store.conn.commit()
return store