- Introduced a new section for the Jinkendo Foundation, detailing design principles for the product family. - Updated README files to include references to the new design principles documentation. - Enhanced the overall documentation structure to improve navigation and accessibility of design resources. - Ensured consistency across documentation related to the Jinkendo Foundation and its principles.
50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
"""Regression: INSERT-Platzhalter müssen zur Wert-Tuple passen."""
|
|
|
|
from data_layer.activity_persistence_orchestrator import (
|
|
insert_activity_csv_minimal,
|
|
insert_activity_from_entry,
|
|
)
|
|
from models import ActivityEntry
|
|
|
|
|
|
class _CaptureCursor:
|
|
def __init__(self):
|
|
self.captured = {}
|
|
|
|
def execute(self, sql, params):
|
|
self.captured["sql"] = sql
|
|
self.captured["params"] = params
|
|
|
|
|
|
def test_insert_activity_from_entry_smoke_with_mock_cursor():
|
|
cur = _CaptureCursor()
|
|
entry = ActivityEntry(date="2026-07-22", activity_type="Laufen")
|
|
insert_activity_from_entry(cur, "profile-1", "entry-1", entry)
|
|
assert cur.captured["params"] is not None
|
|
assert cur.captured["sql"].count("%s") == len(cur.captured["params"])
|
|
|
|
|
|
def test_insert_activity_csv_minimal_smoke_with_mock_cursor():
|
|
cur = _CaptureCursor()
|
|
insert_activity_csv_minimal(
|
|
cur,
|
|
"profile-1",
|
|
"entry-1",
|
|
date_iso="2026-07-22",
|
|
start_time=None,
|
|
end_time=None,
|
|
activity_type="Laufen",
|
|
duration_min=45,
|
|
kcal_active=None,
|
|
kcal_resting=None,
|
|
hr_avg=None,
|
|
hr_max=None,
|
|
distance_km=None,
|
|
training_type_id=1,
|
|
training_category="cardio",
|
|
training_subcategory=None,
|
|
source="csv",
|
|
)
|
|
assert cur.captured["params"] is not None
|
|
assert cur.captured["sql"].count("%s") == len(cur.captured["params"])
|