forked from pool/python-mechanize
* http.cookiejar changed behaviour from Python 3.11 onwards, support
both.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mechanize?expand=0&rev=56
36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
Index: mechanize-0.4.8/test/test_cookies.py
|
|
===================================================================
|
|
--- mechanize-0.4.8.orig/test/test_cookies.py
|
|
+++ mechanize-0.4.8/test/test_cookies.py
|
|
@@ -1015,13 +1015,23 @@ class CookieTests(unittest.TestCase):
|
|
r'port="90,100, 80,8080"; '
|
|
r'max-age=100; Comment = "Just kidding! (\"|\\\\) "')
|
|
|
|
- versions = [1, 1, 1, 0, 1]
|
|
- names = ["bang", "foo", "foo", "spam", "foo"]
|
|
- domains = [
|
|
- ".sol.no", "blah.spam.org", "www.acme.com", "www.acme.com",
|
|
- "www.acme.com"
|
|
- ]
|
|
- paths = ["/", "/", "/", "/blah", "/blah/"]
|
|
+ # Python 3.11+ no longer sort cookies when returning them.
|
|
+ if sys.version_info >= (3, 11):
|
|
+ versions = [1, 0, 1, 1, 1]
|
|
+ names = ["foo", "spam", "foo", "foo", "bang"]
|
|
+ domains = [
|
|
+ "blah.spam.org", "www.acme.com", "www.acme.com",
|
|
+ "www.acme.com", ".sol.no"
|
|
+ ]
|
|
+ paths = ["/", "/blah", "/blah/", "/", "/"]
|
|
+ else:
|
|
+ versions = [1, 1, 1, 0, 1]
|
|
+ names = ["bang", "foo", "foo", "spam", "foo"]
|
|
+ domains = [
|
|
+ ".sol.no", "blah.spam.org", "www.acme.com", "www.acme.com",
|
|
+ "www.acme.com"
|
|
+ ]
|
|
+ paths = ["/", "/", "/", "/blah", "/blah/"]
|
|
|
|
# sequential iteration
|
|
for i in range(4):
|