File: 0004-DRYer.patch

package info (click to toggle)
python-mechanize 1%3A0.4.8%2Bpypi-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,612 kB
  • sloc: python: 16,644; makefile: 11
file content (29 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Tue, 24 May 2022 17:54:50 +0530
Subject: DRYer

---
 test/test_cookies.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/test/test_cookies.py b/test/test_cookies.py
index e699e3e..20055d8 100644
--- a/test/test_cookies.py
+++ b/test/test_cookies.py
@@ -1025,14 +1025,9 @@ class CookieTests(unittest.TestCase):
 
         # sequential iteration
         for i in range(4):
-            i = 0
-            for c in cs:
+            for c, expected in zip(cs, zip(versions, names, domains, paths)):
                 # assert isinstance(c, Cookie)
-                self.assertEqual(c.version, versions[i])
-                self.assertEqual(c.name, names[i])
-                self.assertEqual(c.domain, domains[i])
-                self.assertEqual(c.path, paths[i])
-                i = i + 1
+                self.assertEqual((c.version, c.name, c.domain, c.path), expected)
 
         self.assertRaises(IndexError, lambda cs=cs: cs[5])