(self)
| 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 |
nothing calls this directly
no test coverage detected