MCPcopy
hub / github.com/pallets/werkzeug / test_unauthorized_www_authenticate

Function test_unauthorized_www_authenticate

tests/test_exceptions.py:100–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99
100def test_unauthorized_www_authenticate():
101 basic = WWWAuthenticate("basic", {"realm": "test"})
102 digest = WWWAuthenticate("digest", {"realm": "test", "nonce": "test"})
103
104 exc = exceptions.Unauthorized(www_authenticate=basic)
105 h = Headers(exc.get_headers({}))
106 assert h["WWW-Authenticate"] == str(basic)
107
108 exc = exceptions.Unauthorized(www_authenticate=[digest, basic])
109 h = Headers(exc.get_headers({}))
110 assert h.get_all("WWW-Authenticate") == [str(digest), str(basic)]
111
112 exc = exceptions.Unauthorized()
113 h = Headers(exc.get_headers({}))
114 assert "WWW-Authenticate" not in h
115
116
117def test_response_header_content_type_should_contain_charset():

Callers

nothing calls this directly

Calls 4

get_headersMethod · 0.95
get_allMethod · 0.95
WWWAuthenticateClass · 0.90
HeadersClass · 0.90

Tested by

no test coverage detected