Esempio n. 1
0
def test_mimetype_set_property() -> None:
    base_request_response = _BaseRequestResponse(None)
    base_request_response.mimetype = 'text/html'
    assert base_request_response.headers[
        'Content-Type'] == 'text/html; charset=utf-8'
    base_request_response.mimetype = 'application/json'
    assert base_request_response.headers['Content-Type'] == 'application/json'
Esempio n. 2
0
def test_mimetype_set_property() -> None:
    base_request_response = _BaseRequestResponse(None)
    base_request_response.mimetype = "text/html"
    assert base_request_response.headers[
        "Content-Type"] == "text/html; charset=utf-8"
    base_request_response.mimetype = "application/json"
    assert base_request_response.headers["Content-Type"] == "application/json"
Esempio n. 3
0
def test_mimetype_get_property() -> None:
    base_request_response = _BaseRequestResponse(
        {'Content-Type': 'text/html; charset=utf-8'})
    assert base_request_response.mimetype == 'text/html'
    assert base_request_response.mimetype_params == {'charset': 'utf-8'}
Esempio n. 4
0
def test_mimetype_get_property() -> None:
    base_request_response = _BaseRequestResponse(
        {"Content-Type": "text/html; charset=utf-8"})
    assert base_request_response.mimetype == "text/html"
    assert base_request_response.mimetype_params == {"charset": "utf-8"}