def test_can_use_resource_with_template_uri(): resource_tmpl = ResourceTemplate("http://localhost:8080/person/{name}") for name in PEOPLE.keys(): with resource_tmpl.expand(name=name).get() as response: assert isinstance(response, JSONResponse) assert assembled(response) == PEOPLE[name]
def test_can_get_multi_object_json_resource(): resource = Resource("http://localhost:8080/person/") with resource.get() as response: assert isinstance(response, JSONResponse) for (name,), person in grouped(response): assert assembled(person) == PEOPLE[name]
def test_can_get_simple_json_resource(): resource = Resource("http://localhost:8080/object") with resource.get() as response: assert isinstance(response, JSONResponse) assert assembled(response) == OBJECT