params = QueryParams(params)
for param in params:
- item, *extras = params.getlist(param)
+ item, *extras = params.get_list(param)
self[param] = item
if extras:
self._list.extend((param, e) for e in extras)
message = (
"QueryParams.getlist() is pending deprecation. Use QueryParams.get_list()"
)
- warnings.warn(message, PendingDeprecationWarning)
+ warnings.warn(message, DeprecationWarning)
return self.get_list(key)
def getlist(self, key: str, split_commas: bool = False) -> typing.List[str]:
message = "Headers.getlist() is pending deprecation. Use Headers.get_list()"
- warnings.warn(message, PendingDeprecationWarning)
+ warnings.warn(message, DeprecationWarning)
return self.get_list(key, split_commas=split_commas)
"""
if not hasattr(self, "_decoder"):
decoders: typing.List[Decoder] = []
- values = self.headers.getlist("content-encoding", split_commas=True)
+ values = self.headers.get_list("content-encoding", split_commas=True)
for value in values:
value = value.strip().lower()
try:
assert h.get("a") == "123, 456"
assert h.get("nope", default=None) is None
assert h.get_list("a") == ["123", "456"]
+
+ with pytest.warns(DeprecationWarning):
+ assert h.getlist("a") == ["123", "456"]
+
assert list(h.keys()) == ["a", "b"]
assert list(h.values()) == ["123, 456", "789"]
assert list(h.items()) == [("a", "123, 456"), ("b", "789")]
assert q.get("a") == "456"
assert q.get("nope", default=None) is None
assert q.get_list("a") == ["123", "456"]
+
+ with pytest.warns(DeprecationWarning):
+ assert q.getlist("a") == ["123", "456"]
+
assert list(q.keys()) == ["a", "b"]
assert list(q.values()) == ["456", "789"]
assert list(q.items()) == [("a", "456"), ("b", "789")]