Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33a2e5bb1f | ||
|
|
5930bb67a6 | ||
|
|
4c360f43fd | ||
|
|
6387f5ddc9 | ||
|
|
23a0308d40 | ||
|
|
a7d563d566 | ||
|
|
f2d91bd4d2 | ||
|
|
8c628c69fb |
@@ -1 +1 @@
|
||||
__version__ = "19.12.4"
|
||||
__version__ = "19.12.5"
|
||||
|
||||
@@ -260,9 +260,12 @@ class Request:
|
||||
:type errors: str
|
||||
:return: RequestParameters
|
||||
"""
|
||||
if not self.parsed_args[
|
||||
(keep_blank_values, strict_parsing, encoding, errors)
|
||||
]:
|
||||
if (
|
||||
keep_blank_values,
|
||||
strict_parsing,
|
||||
encoding,
|
||||
errors,
|
||||
) not in self.parsed_args:
|
||||
if self.query_string:
|
||||
self.parsed_args[
|
||||
(keep_blank_values, strict_parsing, encoding, errors)
|
||||
@@ -328,9 +331,12 @@ class Request:
|
||||
:type errors: str
|
||||
:return: list
|
||||
"""
|
||||
if not self.parsed_not_grouped_args[
|
||||
(keep_blank_values, strict_parsing, encoding, errors)
|
||||
]:
|
||||
if (
|
||||
keep_blank_values,
|
||||
strict_parsing,
|
||||
encoding,
|
||||
errors,
|
||||
) not in self.parsed_not_grouped_args:
|
||||
if self.query_string:
|
||||
self.parsed_not_grouped_args[
|
||||
(keep_blank_values, strict_parsing, encoding, errors)
|
||||
|
||||
12
setup.py
12
setup.py
@@ -5,6 +5,7 @@ import codecs
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from distutils.util import strtobool
|
||||
|
||||
from setuptools import setup
|
||||
@@ -24,6 +25,7 @@ class PyTest(TestCommand):
|
||||
|
||||
def run_tests(self):
|
||||
import shlex
|
||||
|
||||
import pytest
|
||||
|
||||
errno = pytest.main(shlex.split(self.pytest_args))
|
||||
@@ -38,7 +40,9 @@ def open_local(paths, mode="r", encoding="utf8"):
|
||||
|
||||
with open_local(["sanic", "__version__.py"], encoding="latin1") as fp:
|
||||
try:
|
||||
version = re.findall(r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M)[0]
|
||||
version = re.findall(
|
||||
r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M
|
||||
)[0]
|
||||
except IndexError:
|
||||
raise RuntimeError("Unable to determine version.")
|
||||
|
||||
@@ -68,9 +72,11 @@ setup_kwargs = {
|
||||
],
|
||||
}
|
||||
|
||||
env_dependency = '; sys_platform != "win32" ' 'and implementation_name == "cpython"'
|
||||
env_dependency = (
|
||||
'; sys_platform != "win32" ' 'and implementation_name == "cpython"'
|
||||
)
|
||||
ujson = "ujson>=1.35" + env_dependency
|
||||
uvloop = "uvloop>=0.5.3" + env_dependency
|
||||
uvloop = "uvloop>=0.5.3,<0.15.0" + env_dependency
|
||||
|
||||
requirements = [
|
||||
"httptools>=0.0.10",
|
||||
|
||||
@@ -244,6 +244,17 @@ def test_query_string(app):
|
||||
assert request.args.getlist("test1") == ["1"]
|
||||
assert request.args.get("test3", default="My value") == "My value"
|
||||
|
||||
def test_popped_stays_popped(app):
|
||||
@app.route("/")
|
||||
async def handler(request):
|
||||
return text("OK")
|
||||
|
||||
request, response = app.test_client.get(
|
||||
"/", params=[("test1", "1")]
|
||||
)
|
||||
|
||||
assert request.args.pop("test1") == ["1"]
|
||||
assert "test1" not in request.args
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_query_string_asgi(app):
|
||||
|
||||
Reference in New Issue
Block a user