This commit is contained in:
Tom Christie 2019-05-14 14:35:55 +01:00
parent 73d5fca823
commit 8f4abe057b
2 changed files with 17 additions and 7 deletions

View File

@ -3,16 +3,19 @@ import json
import pytest
from httpcore import Client, Response
from .utils import MockHTTP2Backend
def app(request):
content = json.dumps({
"method": request.method,
"path": request.url.path,
"body": request.content.decode(),
}).encode()
headers = {'Content-Length': str(len(content))}
content = json.dumps(
{
"method": request.method,
"path": request.url.path,
"body": request.content.decode(),
}
).encode()
headers = {"Content-Length": str(len(content))}
return Response(200, headers=headers, content=content)

View File

@ -5,7 +5,14 @@ import h2.config
import h2.connection
import h2.events
from httpcore import AsyncioBackend, BaseReader, BaseWriter, Protocol, Request, TimeoutConfig
from httpcore import (
AsyncioBackend,
BaseReader,
BaseWriter,
Protocol,
Request,
TimeoutConfig,
)
class MockHTTP2Backend(AsyncioBackend):