def test_dispatch(): dispatcher = RequestDispatcher() dispatcher.register( r"/hello", dummy_endpoint, RawSerializer(), RawSerializer(), ) endpoint = dispatcher.handlers.get("/hello")[0] assert endpoint == dummy_endpoint
def test_body(): serializer = RawSerializer() obj = object() assert obj == serializer.serialize_body(obj) assert obj == serializer.deserialize_body(obj)
def test_header(): serializer = RawSerializer() obj = object() assert obj == serializer.serialize_header(obj) assert obj == serializer.deserialize_header(obj)