File size: 1,052 Bytes
49ad56c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from pathlib import Path

import pytest

from multi_agent_sdlc.cli import parse_args


def test_parse_args_selects_project_description() -> None:
    args = parse_args(
        [
            "--project-description",
            "project_descriptions/url_shortener.md",
        ]
    )

    assert args.project_description == Path("project_descriptions/url_shortener.md")
    assert args.resume is None


def test_parse_args_selects_workflow_to_resume() -> None:
    args = parse_args(
        [
            "--resume",
            "thread-id",
            "--checkpoint-id",
            "checkpoint-id",
        ]
    )

    assert args.resume == "thread-id"
    assert args.checkpoint_id == "checkpoint-id"
    assert args.project_description is None


def test_parse_args_rejects_checkpoint_without_resume() -> None:
    with pytest.raises(SystemExit):
        parse_args(
            [
                "--project-description",
                "project.md",
                "--checkpoint-id",
                "checkpoint-id",
            ]
        )