Esempio n. 1
0
async def test_ctor_text_for_empty_body() -> None:
    with pytest.warns(DeprecationWarning):
        resp = web.HTTPResetContent(text="text")
    assert resp.text == "text"
    assert resp.headers == {"Content-Type": "text/plain"}
    assert resp.reason == "Reset Content"
    assert resp.status == 205
Esempio n. 2
0
async def test_ctor_content_type_without_text() -> None:
    with pytest.warns(DeprecationWarning):
        resp = web.HTTPResetContent(content_type="custom")
    assert resp.text is None
    assert resp.headers == {"Content-Type": "custom"}
    assert resp.reason == "Reset Content"
    assert resp.status == 205
    assert bool(resp)
Esempio n. 3
0
def test_empty_text_205() -> None:
    resp = web.HTTPResetContent()
    assert resp.text is None