-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
Working template get_function_url with test #1004
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
for more information, see https://pre-commit.ci
CodSpeed Performance ReportMerging #1004 will not alter performanceComparing Summary
|
I'm stuck. See #996 (comment) |
for more information, see https://pre-commit.ci
…n. ruff fixes. Safety check for no robyn object.
Hi, @sansyrox I think the test failures are CI timeouts, this has passed all the tests at some point since the last change. Can we merge? |
Hi @sansyrox |
07f28de
to
0b766c9
Compare
Description
This PR starts the process of implementing url_for so that Jinja templates can reference Robyn endpoints by function name rather than path see #996
Summary
[Updated]
This PR adds a url_for that returns a fixed string and a test for this.3rd Nov 24 Now looks up functions via the Robyn object router
7th Nov. All finished.
Changes are limited to 7 files (5 of them related to testing)
add_function_to_globals()
)sync_auth
function/sync_auth
in an href)TODO handle positional and named argumentsTODO add set_robyn and url_for to template_interfaceTODO warn if no Robyn object set using set_robynTODO improve response to an invalid route
TODO rename from url_for to get_function_url in preparation for adding get_static_urlTODO remove@pytest.mark.url_for
from test_get_requests.py`jinja_template = JinjaTemplate(".", "utf-8")#solves my git locale pre-commit issueTODO add unit testsTODO add unit tests that cover combinations of url'sTODO documentation
PR Checklist
Please ensure that:
Pre-Commit Instructions:
I think I've done that. I'm running the tests from a separate clone which I have had to modify to work with Python 3.12.7