canaille-globuzma/tests/test_flaskutils.py

19 lines
557 B
Python
Raw Normal View History

from canaille.flaskutils import set_parameter_in_url_query
def test_set_parameter_in_url_query():
assert (
set_parameter_in_url_query("https://auth.mydomain.tld", foo="bar")
== "https://auth.mydomain.tld?foo=bar"
)
assert (
set_parameter_in_url_query("https://auth.mydomain.tld?foo=baz", foo="bar")
== "https://auth.mydomain.tld?foo=bar"
)
assert (
set_parameter_in_url_query("https://auth.mydomain.tld?foo=baz", hello="world")
== "https://auth.mydomain.tld?foo=baz&hello=world"
)