-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71863a1
commit 652a240
Showing
3 changed files
with
113 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from goose.toolkit.utils import parse_plan | ||
|
||
|
||
def test_parse_plan_simple(): | ||
plan_str = ( | ||
"Here is python repo\n" | ||
"-use uv\n" | ||
"-do not use poetry\n\n" | ||
"Now you should:\n\n" | ||
"-Open a file\n" | ||
"-Run a test" | ||
) | ||
expected_result = { | ||
"kickoff_message": "Here is python repo\n-use uv\n-do not use poetry\n\nNow you should:", | ||
"tasks": ["-Open a file", "-Run a test"], | ||
} | ||
assert expected_result == parse_plan(plan_str) | ||
|
||
|
||
def test_parse_plan_multiple_groups(): | ||
plan_str = ( | ||
"Here is python repo\n" | ||
"-use uv\n" | ||
"-do not use poetry\n\n" | ||
"Now you should:\n\n" | ||
"-Open a file\n" | ||
"-Run a test\n\n" | ||
"Now actually follow the steps:\n" | ||
"-Step1\n" | ||
"-Step2" | ||
) | ||
expected_result = { | ||
"kickoff_message": ( | ||
"Here is python repo\n" | ||
"-use uv\n" | ||
"-do not use poetry\n\n" | ||
"Now you should:\n\n" | ||
"-Open a file\n" | ||
"-Run a test\n\n" | ||
"Now actually follow the steps:" | ||
), | ||
"tasks": ["-Step1", "-Step2"], | ||
} | ||
assert expected_result == parse_plan(plan_str) | ||
|
||
|
||
def test_parse_plan_empty_tasks(): | ||
plan_str = "Here is python repo" | ||
expected_result = {"kickoff_message": "Here is python repo", "tasks": []} | ||
assert expected_result == parse_plan(plan_str) | ||
|
||
|
||
def test_parse_plan_empty_kickoff_message(): | ||
plan_str = "-task1\n-task2" | ||
expected_result = {"kickoff_message": "", "tasks": ["-task1", "-task2"]} | ||
assert expected_result == parse_plan(plan_str) |