def resource_test(self): response = ({'code': 200, 'content-type': \ 'text/plain; charset=utf-8'}, 'Hello') r = Response(response) assert r.resource() == 'Hello'
def link_test(self): response = ({'code': 200, 'link': '</feed>; rel="alternate"'}, 'Hello') r = Response(response) link = r.link('alternate') assert link.href == '/feed' assert link.rel == 'alternate'
def link_test(): response = ({'status': 200, 'link': '</feed>; rel="alternate"'}, 'Hello') r = Response(response) link = r.link('alternate') assert link.href == '/feed' assert link.rel == 'alternate'
def resource_test(self): response = ({'status': 200, 'content-type': \ 'text/plain; charset=utf-8'}, 'Hello') r = Response(response) assert r.resource() == 'Hello'
def trivial_test(): response = ({'status': 200}, 'Hello') r = Response(response) assert r.body == 'Hello' assert r.code == 200
def resource_test(self): response = ({'status': 200, 'content-type': 'text/plain; charset=utf-8'}, \ 'Hello') r = Response(response) pipe, child_pipe = Pipe() lazy_response = LazyResponse(child_pipe) pipe.send(r) assert lazy_response.resource() == 'Hello'
def simple_test(self): response = ({'status': 200}, 'Hello') r = Response(response) pipe, child_pipe = Pipe() lazy_response = LazyResponse(child_pipe) pipe.send(r) assert lazy_response.code == 200 assert lazy_response.body == 'Hello'
def link_test(self): response = ({ 'status': 200, 'link': '</feed>; rel="alternate"' }, 'Hello') r = Response(response) pipe, child_pipe = Pipe() lazy_response = LazyResponse(child_pipe) pipe.send(r) link = lazy_response.link('alternate') assert link.href == '/feed' assert link.rel == 'alternate'
def resource_test(): response = ({"status": 200, "content-type": "text/plain; charset=utf-8"}, "Hello") r = Response(response) assert r.resource() == "Hello"