refactor: add missing exports, better error handling, and handle boolean query params (#1422)
Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run

This commit is contained in:
Juro Oravec 2025-09-30 21:49:28 +02:00 committed by GitHub
parent e9d1b6c4b2
commit 8957befd1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 552 additions and 371 deletions

View file

@ -307,6 +307,18 @@ class TestComponentAsView:
== f"/components/ext/view/components/{TestComponent.class_id}/?f%27oo=b+ar%26ba%27z#q%20u%22x"
)
# Converts `True` to no flag parameter (no value, e.g. `enabled` instead of `enabled=True`)
# And filters out `False` and `None` values
component_url3 = get_component_url(
TestComponent,
query={"f'oo": "b ar&ba'z", "true_key": True, "false_key": False, "none_key": None},
fragment='q u"x',
)
assert (
component_url3
== f"/components/ext/view/components/{TestComponent.class_id}/?f%27oo=b+ar%26ba%27z&true_key#q%20u%22x"
)
# Merges query params from original URL
component_url4 = format_url(
"/components/ext/view/components/123?foo=123&bar=456#abc",