Skip to content

Commit 736f9da

Browse files
authored
Merge pull request #106 from proactiveops/fix-params
Fix query params handling: query -> params
2 parents ac9319f + c9386ca commit 736f9da

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

picorun/picorun.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def to_kwargs(self) -> dict[str, Any]:
2727
"""Convert the object to a dictionary of keyword arguments for requests."""
2828
output = {}
2929
for property in ["headers", "json", "query"]:
30-
output[property] = getattr(self, property)
30+
key = property if property != "query" else "params"
31+
output[key] = getattr(self, property)
3132
return output
3233

3334

tests/test_picorun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_api_request_args() -> None:
3939
assert args.to_kwargs() == {
4040
"headers": {"headers": "value"},
4141
"json": {"payload": "value"},
42-
"query": {"query": "value"},
42+
"params": {"query": "value"},
4343
}
4444

4545

@@ -53,7 +53,7 @@ def test_api_request_empty_args() -> None:
5353
assert args.to_kwargs() == {
5454
"headers": {},
5555
"json": {},
56-
"query": {},
56+
"params": {},
5757
}
5858

5959

0 commit comments

Comments
 (0)