Repository navigation
Expand file tree
/
Copy pathtest_strategy.py
More file actions
61 lines (51 loc) · 1.7 KB
/
Copy pathtest_strategy.py
File metadata and controls
61 lines (51 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
Simple test to verify the strategy package structure.
"""
from pathlib import Path
from planfile.loaders.yaml_loader import load_strategy_yaml
from planfile.models import Sprint, Strategy, Task, TaskType
def test_basic_models():
"""Test basic model creation."""
# Create a simple strategy
strategy = Strategy(
name="Test Strategy",
project_type="web",
domain="test",
goal="Test the strategy package",
sprints=[
Sprint(
id=1,
name="Test Sprint",
length_days=14,
objectives=["Test objective"],
tasks=[Task(name="test-task", description="Test task")]
)
],
tasks={
"patterns": [
Task(
name="Test Task",
description="A test task pattern",
type=TaskType.feature
)
]
}
)
assert strategy.name == "Test Strategy"
assert len(strategy.sprints) == 1
assert strategy.get_task_patterns()[0].name == "test-task"
print("✓ Basic models work correctly")
def test_yaml_loading():
"""Test YAML loading functionality."""
example_path = Path(__file__).parent / "examples" / "strategies" / "onboarding.yaml"
if example_path.exists():
strategy = load_strategy_yaml(example_path)
assert strategy.name == "Onboarding Strategy"
assert len(strategy.sprints) == 3
print("✓ YAML loading works correctly")
else:
print("⚠ Example YAML file not found, skipping test")
if __name__ == "__main__":
test_basic_models()
test_yaml_loading()
print("\nAll tests passed! 🎉")