(self)
| 253 | assert basic1 != object() |
| 254 | |
| 255 | def test_www_authenticate_header(self): |
| 256 | wa = WWWAuthenticate.from_header('Basic realm="WallyWorld"') |
| 257 | assert wa.type == "basic" |
| 258 | assert wa.realm == "WallyWorld" |
| 259 | wa.realm = "Foo Bar" |
| 260 | assert wa.to_header() == 'Basic realm="Foo Bar"' |
| 261 | |
| 262 | wa = WWWAuthenticate("bearer") |
| 263 | assert wa.to_header() == "Bearer" |
| 264 | |
| 265 | wa = WWWAuthenticate.from_header( |
| 266 | 'Digest realm="testrealm@host.com",' |
| 267 | ' qop="auth,auth-int",' |
| 268 | ' nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",' |
| 269 | ' opaque="5ccc069c403ebaf9f0171e9517f40e41"' |
| 270 | ) |
| 271 | assert wa.type == "digest" |
| 272 | assert wa.realm == "testrealm@host.com" |
| 273 | assert wa.parameters["qop"] == "auth,auth-int" |
| 274 | assert wa.nonce == "dcd98b7102dd2f0e8b11d0f600bfb0c093" |
| 275 | assert wa.opaque == "5ccc069c403ebaf9f0171e9517f40e41" |
| 276 | |
| 277 | assert WWWAuthenticate.from_header("broken").type == "broken" |
| 278 | assert WWWAuthenticate.from_header("") is None |
| 279 | |
| 280 | def test_www_authenticate_token_padding(self): |
| 281 | # padded with = |
nothing calls this directly
no test coverage detected