from gamla import url_utils


def test_add_to_query_string1():
    assert (
        url_utils.add_to_query_string(
            {"a": 123},
            "https://www.domain.com/path?param1=param1#anchor",
        )
        == "https://www.domain.com/path?param1=param1&a=123#anchor"
    )


def test_add_to_query_string2():
    assert (
        url_utils.add_to_query_string(
            {"param1": 123},
            "https://www.domain.com/path?param1=param1#anchor",
        )
        == "https://www.domain.com/path?param1=123#anchor"
    )

[((6, 8, 9, 9), 'gamla.url_utils.add_to_query_string', 'url_utils.add_to_query_string', ({(7, 12, 7, 22): "{'a': 123}", (8, 12, 8, 62): '"""https://www.domain.com/path?param1=param1#anchor"""'}, {}), "({'a': 123},\n    'https://www.domain.com/path?param1=param1#anchor')", False, 'from gamla import url_utils\n'), ((16, 8, 19, 9), 'gamla.url_utils.add_to_query_string', 'url_utils.add_to_query_string', ({(17, 12, 17, 27): "{'param1': 123}", (18, 12, 18, 62): '"""https://www.domain.com/path?param1=param1#anchor"""'}, {}), "({'param1': 123},\n    'https://www.domain.com/path?param1=param1#anchor')", False, 'from gamla import url_utils\n')]