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

Method test_authorization_token_padding

tests/test_http.py:222–233  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 assert a.to_header() == 'Digest foo, bar=""'
221
222 def test_authorization_token_padding(self):
223 # padded with =
224 token = base64.b64encode(b"This has base64 padding").decode()
225 a = Authorization.from_header(f"Token {token}")
226 assert a.type == "token"
227 assert a.token == token
228
229 # padded with ==
230 token = base64.b64encode(b"This has base64 padding..").decode()
231 a = Authorization.from_header(f"Token {token}")
232 assert a.type == "token"
233 assert a.token == token
234
235 def test_authorization_basic_incorrect_padding(self):
236 assert Authorization.from_header("Basic foo") is None

Callers

nothing calls this directly

Calls 1

from_headerMethod · 0.45

Tested by

no test coverage detected