Skip to content

Commit 8d84ce6

Browse files
author
Esteban Echeverry
committed
Merge branch 'feat/06_main'
2 parents 251f18e + 567e1b5 commit 8d84ce6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

taskit/infrastructure/cli/report.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ def report(obj):
1010

1111
@report.command()
1212
@click.option('--project_id', default="")
13+
@click.option('--stage', default="")
1314
@click.pass_obj
14-
def tasks(obj, project_id):
15+
def tasks(obj, project_id, stage):
1516
if project_id:
16-
result = obj.state_reporter.list_tasks_in_project(project_id)
17+
result = obj.state_reporter.list_tasks_in_project(project_id)
18+
elif stage:
19+
result = obj.state_reporter.list_tasks_in_stage(stage)
1720
else:
1821
result = obj.state_reporter.list_tasks()
1922
click.echo(tabulate(result, headers='keys'))

tests/infrastructure/cli/test_report.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ def test_cli_report_tasks_in_project(mock_state: Mock):
1919
assert result.exit_code != 0
2020

2121

22+
def test_cli_report_tasks_in_stage(mock_state: Mock):
23+
runner = CliRunner()
24+
result = runner.invoke(
25+
cli, ['report', 'tasks', '--stage=New'], obj=mock_state)
26+
mock_state.state_reporter.list_tasks_in_stage.assert_called_with(ANY)
27+
assert result.exit_code != 0
28+
29+
2230
def test_cli_report_projects(mock_state: Mock):
2331
runner = CliRunner()
2432
result = runner.invoke(

0 commit comments

Comments
 (0)