__init__.py 494 B

12345678910111213141516171819202122232425
  1. # Copyright (c) Jupyter Development Team.
  2. # Distributed under the terms of the Modified BSD License.
  3. from typing import NamedTuple
  4. class Response(NamedTuple):
  5. """Fake tornado response."""
  6. body: bytes
  7. def fake_client_factory():
  8. class FakeClient:
  9. """Fake AsyncHTTPClient
  10. body can be set in the test to a custom value.
  11. """
  12. body = b""
  13. async def fetch(*args, **kwargs):
  14. return Response(FakeClient.body)
  15. return FakeClient