Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tests/apimatic_core/utility_tests/test_api_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,4 +1169,17 @@ def test_update_entry_by_json_pointer(self, initial_dict, pointer, new_value, in

assert result == expected_dict
if not inplace:
assert initial_dict == original_copy
assert initial_dict == original_copy

@pytest.mark.parametrize("url, expected", [
(None, {}),
("https://example.com/path?name=Sufyan", {"name": "Sufyan"}),
("https://example.com/api?name=John&role=Engineer", {"name": "John", "role": "Engineer"}),
("https://example.com/home", {}),
("https://example.com/search?tag=python&tag=testing", {"tag": "testing"}), # last one wins
("https://example.com/?name=John%20Doe&role=Senior%20Engineer",
{"name": "John Doe", "role": "Senior Engineer"}),
("https://example.com/?debug=&verbose=true", {"verbose": "true"}),
])
def test_get_query_parameters(self, url, expected):
assert ApiHelper.get_query_parameters(url) == expected