Beispiel #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'
Beispiel #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"
Beispiel #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'}
Beispiel #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"}