File size: 1,055 Bytes
5dc68a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
import sys

# Add project root to path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from main import parse_args


def test_parse_args_schedule_defaults(monkeypatch):
    monkeypatch.setattr(
        sys,
        "argv",
        [
            "main.py",
            "--cities",
            "Amsterdam",
            "--checkin",
            "2026-03-01",
            "--checkout",
            "2026-03-05",
        ],
    )

    args = parse_args()
    assert args.schedule_minutes == 0
    assert args.max_runs == 0


def test_parse_args_schedule_custom(monkeypatch):
    monkeypatch.setattr(
        sys,
        "argv",
        [
            "main.py",
            "--cities",
            "Amsterdam",
            "--checkin",
            "2026-03-01",
            "--checkout",
            "2026-03-05",
            "--schedule-minutes",
            "15",
            "--max-runs",
            "3",
        ],
    )

    args = parse_args()
    assert args.schedule_minutes == 15
    assert args.max_runs == 3