Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai>
Co-authored-by: Clement Sirieix <clem.sirieix@gmail.com>
Co-authored-by: Antoine W <antoine.wronka@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mathias Gesbert 2026-03-09 19:28:09 +01:00 committed by GitHub
parent 5d2e01a6d7
commit dd372ce494
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
89 changed files with 2086 additions and 596 deletions

View file

@ -0,0 +1,42 @@
from __future__ import annotations
from vibe.core.paths.global_paths import PLANS_DIR
from vibe.core.plan_session import PlanSession
class TestPlanSession:
def test_lazy_initialization(self) -> None:
session = PlanSession()
assert session._plan_file_path is None
def test_stable_path(self) -> None:
session = PlanSession()
first = session.plan_file_path
second = session.plan_file_path
assert first == second
def test_md_extension(self) -> None:
session = PlanSession()
assert session.plan_file_path.suffix == ".md"
def test_name_format(self) -> None:
session = PlanSession()
stem = session.plan_file_path.stem
parts = stem.split("-", 1)
assert len(parts) == 2
timestamp_str, slug = parts
assert timestamp_str.isdigit()
assert len(slug.split("-")) == 3
def test_plan_file_path_str_matches(self) -> None:
session = PlanSession()
assert session.plan_file_path_str == str(session.plan_file_path)
def test_path_under_plans_dir(self) -> None:
session = PlanSession()
assert session.plan_file_path.parent == PLANS_DIR.path
def test_different_sessions_get_different_paths(self) -> None:
session1 = PlanSession()
session2 = PlanSession()
assert session1.plan_file_path != session2.plan_file_path