fix: 即席查询从登记过的入口续票据,有效必须能进入查询
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import asyncio
|
||||
|
||||
from app.nqi.adhoc import ENTRY, ensure_session
|
||||
|
||||
|
||||
def test_adhoc_session_uses_the_registered_service():
|
||||
assert ENTRY.endswith("/pro-adhoc/index")
|
||||
seen = {}
|
||||
|
||||
class Response:
|
||||
status_code = 200
|
||||
|
||||
class url:
|
||||
path = "/pro-adhoc/index"
|
||||
|
||||
class Client:
|
||||
async def _request(self, method, url, **kwargs):
|
||||
seen["method"] = method
|
||||
seen["url"] = url
|
||||
seen["accept"] = kwargs["headers"]["Accept"]
|
||||
return Response()
|
||||
|
||||
asyncio.run(ensure_session(Client()))
|
||||
assert seen["method"] == "GET"
|
||||
assert seen["url"] == ENTRY
|
||||
assert seen["accept"].startswith("text/html")
|
||||
Reference in New Issue
Block a user