Пример #1
0
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"
Пример #2
0
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"
Пример #3
0
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"
Пример #4
0
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"