Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement steps for "created issues are listed" scenario
- Loading branch information
Showing
3 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,35 @@ | ||
from behave import given, when, then | ||
import fix_cli | ||
|
||
|
||
@given(u'an empty issue repository') | ||
def empty_repository(context): | ||
pass | ||
|
||
|
||
@when(u'we list all issues') | ||
def list_issues(context): | ||
fix_cli.start_fix(context, "list") | ||
|
||
|
||
def _create_issue(context, title, description): | ||
fix_cli.start_fix(context, f'create --title "{title}" --descr "{description}"') | ||
|
||
|
||
@when(u'we create an issue titled "{title}" with description') | ||
def create_issue(context, title): | ||
description=context.text or "" | ||
fix_cli.start_fix(context, f'create --title "{title}" --descr "{description}"') | ||
description = context.text or "" | ||
_create_issue(context, title, description) | ||
|
||
|
||
@when(u'we create an issue titled "{title}"') | ||
def create_issue_random_description(context, title): | ||
description = "Dorem Fixum dolor sit amet..." | ||
_create_issue(context, title, description) | ||
|
||
|
||
@then(u'it prints a list of issues') | ||
def check_issue_list(context): | ||
context.fix.expect(r'ID\W+STATUS\W+TITLE') | ||
for row in context.table: | ||
fix_cli.check_output(context, f'{row["issue ID prefix"]}-[hash]\\W+{row["status"]}\\W+"{row["title"]}"') |