INITIAL COMMIT
This commit is contained in:
56
tests/test_analyze_dump.py
Normal file
56
tests/test_analyze_dump.py
Normal file
@ -0,0 +1,56 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_analyze_dump_finds_and_clones_fixture(tmp_path: Path) -> None:
|
||||
fixture = tmp_path / "coach.json"
|
||||
fixture.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"date": "2026-06-16",
|
||||
"workout": {
|
||||
"workoutName": "Coach Ride",
|
||||
"sportType": {"sportTypeKey": "cycling"},
|
||||
"estimatedDurationInSecs": 60,
|
||||
"workoutSegments": [
|
||||
{
|
||||
"sportType": {"sportTypeKey": "cycling"},
|
||||
"workoutSteps": [
|
||||
{
|
||||
"type": "ExecutableStepDTO",
|
||||
"stepType": {"stepTypeKey": "warmup"},
|
||||
"endCondition": {"conditionTypeKey": "time"},
|
||||
"endConditionValue": 60,
|
||||
"targetType": {"workoutTargetTypeKey": "no.target"},
|
||||
}
|
||||
],
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"scripts/analyze_dump.py",
|
||||
str(fixture),
|
||||
"--date",
|
||||
"2026-06-16",
|
||||
"--clone-dry-run",
|
||||
],
|
||||
text=True,
|
||||
capture_output=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 0
|
||||
assert "Local clone payload passed validation." in result.stdout
|
||||
assert "GCClone 2026-06-16 Coach Ride" in result.stdout
|
||||
|
||||
Reference in New Issue
Block a user