def test_can_send_header(): resource = Resource("http://localhost:8080/hello") response = resource.put("fred", headers={"X-Upper-Case": True}) assert isinstance(response, TextResponse) content = response.read().decode(response.encoding) assert content == "HELLO, FRED"
def test_can_put_simple_text_resource(): resource = Resource("http://localhost:8080/hello") response = resource.put("fred") assert isinstance(response, TextResponse) content = response.read().decode("utf-8") assert content == "hello, fred"