我有以下夹具来模拟请求。
from aiohttp.test_utils import make_mocked_coro
@pytest.fixture
def valid_request():
pwd = b64encode(b"any:any").decode("ascii")
headers = {"Authorization": f"Basic {pwd}"}
r = Mock()
r.text = make_mocked_coro('test')
r.headers = headers
return r
如何指定查询参数。例如,我想像这里api_token
https://url?api_token=xxx