def testDigestAuthNextNonceAndNC(self):
# Test that if the server sets nextnonce that we reset
# the nonce count back to 1
uri = urllib_parse.urljoin(base, "digest/file.txt")
self.http.add_credentials('joe', 'password')
(response, content) = self.http.request(
uri, "GET", headers={"cache-control": "no-cache"})
info = httplib2._parse_www_authenticate(
response, 'authentication-info')
self.assertEqual(response.status, 200)
(response, content) = self.http.request(
uri, "GET", headers={"cache-control": "no-cache"})
info2 = httplib2._parse_www_authenticate(
response, 'authentication-info')
self.assertEqual(response.status, 200)
if 'nextnonce' in info:
self.assertEqual(info2['nc'], 1)
评论列表
文章目录