Skip to content

Commit e51c4e7

Browse files
committed
Fix cosmetic test failures after status output change
1 parent a6597df commit e51c4e7

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

src/faff_cli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@cli.callback(invoke_without_command=True)
3131
def main(
3232
ctx: typer.Context,
33-
version: bool = typer.Option(None, "--version", help="Show version and exit", is_flag=True),
33+
version: bool = typer.Option(False, "--version", help="Show version and exit"),
3434
):
3535
# Handle --version flag
3636
if version:

tests/test_cli_plan.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,23 @@ def test_plan_remotes_lists_sources(self, temp_faff_dir, monkeypatch):
6868

6969

7070
class TestPlanPullCommand:
71-
"""Test the 'faff plan pull' command."""
71+
"""Test the 'faff pull' command (pulls plans from remotes)."""
7272

7373
def test_plan_pull_all_remotes(self, temp_faff_dir, monkeypatch):
7474
"""Should pull from all remotes when no ID specified."""
7575
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
7676

77-
result = runner.invoke(cli, ["plan", "pull"])
77+
result = runner.invoke(cli, ["pull"])
7878

79-
# Should complete without error
79+
# Should complete without error (even if no remotes configured)
8080
assert result.exit_code == 0
8181

8282
def test_plan_pull_specific_remote(self, temp_faff_dir, monkeypatch):
8383
"""Should pull from specific remote by ID."""
8484
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
8585

8686
# Try pulling from a remote that may not exist
87-
result = runner.invoke(cli, ["plan", "pull", "local"])
87+
result = runner.invoke(cli, ["pull", "local"])
8888

8989
# May fail if "local" remote doesn't exist, which is fine
9090
# assert result.exit_code == 0 or "No plans" in result.stdout or "Unknown" in result.stdout
@@ -93,7 +93,7 @@ def test_plan_pull_invalid_remote(self, temp_faff_dir, monkeypatch):
9393
"""Should fail gracefully for invalid remote ID."""
9494
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
9595

96-
result = runner.invoke(cli, ["plan", "pull", "nonexistent-remote"])
96+
result = runner.invoke(cli, ["pull", "nonexistent-remote"])
9797

9898
# Should either exit with error or show helpful message
9999
assert result.exit_code != 0 or "Unknown" in result.stdout

tests/test_cli_status.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,50 @@
1212
class TestStatusCommand:
1313
"""Test the 'faff status' command."""
1414

15-
def test_status_shows_version(self, temp_faff_dir, monkeypatch):
16-
"""Should display faff-core version."""
15+
def test_status_shows_plans_section(self, temp_faff_dir, monkeypatch):
16+
"""Should display Plans section."""
1717
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
1818

1919
result = runner.invoke(cli, ["status"])
2020

2121
assert result.exit_code == 0
22-
assert "faff-core version:" in result.stdout
22+
assert "Plans:" in result.stdout
2323

24-
def test_status_shows_repo_location(self, temp_faff_dir, monkeypatch):
25-
"""Should display repository location."""
24+
def test_status_shows_today_section(self, temp_faff_dir, monkeypatch):
25+
"""Should display Today section with tracking info."""
2626
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
2727

2828
result = runner.invoke(cli, ["status"])
2929

3030
assert result.exit_code == 0
31-
assert "Ledger:" in result.stdout
31+
assert "Today:" in result.stdout
3232

3333
def test_status_shows_no_active_session(self, temp_faff_dir, monkeypatch):
34-
"""Should indicate when not working on anything."""
34+
"""Should indicate when not tracking anything."""
3535
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
3636

3737
result = runner.invoke(cli, ["status"])
3838

3939
assert result.exit_code == 0
40-
assert "Not currently working on anything" in result.stdout
40+
assert "Not tracking" in result.stdout
4141

42-
def test_status_shows_total_time(self, temp_faff_dir, monkeypatch):
43-
"""Should display total recorded time for today."""
42+
def test_status_shows_compile_section(self, temp_faff_dir, monkeypatch):
43+
"""Should display Logs to Compile section."""
4444
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
4545

4646
result = runner.invoke(cli, ["status"])
4747

4848
assert result.exit_code == 0
49-
assert "Total recorded time for today" in result.stdout
49+
assert "Logs to Compile:" in result.stdout
50+
51+
def test_status_shows_push_section(self, temp_faff_dir, monkeypatch):
52+
"""Should display Timesheets to Push section."""
53+
monkeypatch.setenv("FAFF_DIR", str(temp_faff_dir))
54+
55+
result = runner.invoke(cli, ["status"])
56+
57+
assert result.exit_code == 0
58+
assert "Timesheets to Push:" in result.stdout
5059

5160

5261
class TestInitCommand:

tests/test_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_init_status_workflow(self, tmp_path):
2727
# Check status in new repo
2828
result = runner.invoke(cli, ["status"], env={"FAFF_DIR": str(tmp_path)})
2929
assert result.exit_code == 0
30-
assert "Not currently working on anything" in result.stdout
30+
assert "Not tracking" in result.stdout
3131

3232
def test_create_and_view_log_workflow(self, temp_faff_dir, monkeypatch):
3333
"""
@@ -73,8 +73,8 @@ def test_plan_remotes_pull_workflow(self, temp_faff_dir, monkeypatch):
7373
assert result.exit_code == 0
7474
assert "remote" in result.stdout.lower()
7575

76-
# Pull from remotes
77-
result = runner.invoke(cli, ["plan", "pull"])
76+
# Pull from remotes (now a top-level command)
77+
result = runner.invoke(cli, ["pull"])
7878
assert result.exit_code == 0
7979

8080

0 commit comments

Comments
 (0)