(bsc#1212557) - Remove now unneeded blinker from {Build,}Requires. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpbin?expand=0&rev=25
41 lines
2.2 KiB
Diff
41 lines
2.2 KiB
Diff
Index: python-httpbin-0.7.0+git20181107.f8ec666/test_httpbin.py
|
|
===================================================================
|
|
--- python-httpbin-0.7.0+git20181107.f8ec666.orig/test_httpbin.py
|
|
+++ python-httpbin-0.7.0+git20181107.f8ec666/test_httpbin.py
|
|
@@ -167,8 +167,8 @@ class HttpbinTestCase(unittest.TestCase)
|
|
|
|
def test_base64(self):
|
|
greeting = u'Здравствуй, мир!'
|
|
- b64_encoded = _string_to_base64(greeting)
|
|
- response = self.app.get(b'/base64/' + b64_encoded)
|
|
+ b64_encoded = _string_to_base64(greeting).decode('utf-8')
|
|
+ response = self.app.get('/base64/' + b64_encoded)
|
|
content = response.data.decode('utf-8')
|
|
self.assertEqual(greeting, content)
|
|
|
|
@@ -422,7 +422,7 @@ class HttpbinTestCase(unittest.TestCase)
|
|
body, stale_after + 1)
|
|
self.assertEqual(stale_response.status_code, 401)
|
|
header = stale_response.headers.get('WWW-Authenticate')
|
|
- self.assertIn('stale=TRUE', header)
|
|
+ self.assertIn('stale=True', header)
|
|
|
|
def _test_digest_response_for_auth_request(self, header, username, password, qop, uri, body, nc=1, nonce=None):
|
|
auth_type, auth_info = header.split(None, 1)
|
|
@@ -474,13 +474,13 @@ class HttpbinTestCase(unittest.TestCase)
|
|
wrong_pass_response, nonce = self._test_digest_response_for_auth_request(header, username, "wrongPassword", qop, uri, body)
|
|
self.assertEqual(wrong_pass_response.status_code, 401)
|
|
header = wrong_pass_response.headers.get('WWW-Authenticate')
|
|
- self.assertNotIn('stale=TRUE', header)
|
|
+ self.assertNotIn('stale=True', header)
|
|
|
|
reused_nonce_response, nonce = self._test_digest_response_for_auth_request(header, username, password, qop, uri, \
|
|
body, nonce=nonce)
|
|
self.assertEqual(reused_nonce_response.status_code, 401)
|
|
header = reused_nonce_response.headers.get('WWW-Authenticate')
|
|
- self.assertIn('stale=TRUE', header)
|
|
+ self.assertIn('stale=True', header)
|
|
|
|
def test_drip(self):
|
|
response = self.app.get('/drip?numbytes=400&duration=2&delay=1')
|