-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support markdown plans #79
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious: is this our recommended style for multiline strings? what are the trade offs for this over triple-quoted multiline strings or even keeping the markdown as a fixture? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be honest, I did it to pass the ruff checks. Not sure if we've discussed it before |
||
"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"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit/maybe not even applicable]should we be stripping
then that could be inferred as negative numbers which maybe would change the order of events? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree! |
||
} | ||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can see
-p
being confusing for plan and params... maybe-a/--args
instead? up to you tho!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense! agree