diff options
| author | 2022-05-26 23:57:10 -0400 | |
|---|---|---|
| committer | 2022-05-26 23:57:10 -0400 | |
| commit | 5c903a88dee75fe65fee8cbf337e6a6217eda8ce (patch) | |
| tree | 83b8d6427272f24829e7b01930801a98b4bba5e2 /test/test_util.py | |
| parent | 742762724a171c3171cca4d6680d03ba10e003d6 (diff) | |
| parent | ad61a6d8122973534ab63df48f6090954bc73db6 (diff) | |
Update upstream source from tag 'upstream/1.22.0'
Update to upstream version '1.22.0'
with Debian dir f597b243649bdb1feca741d6879e2c79e5237cde
Diffstat (limited to 'test/test_util.py')
| -rw-r--r-- | test/test_util.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/test_util.py b/test/test_util.py index c269c9e..7ab1175 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -168,11 +168,12 @@ class TestISO639_1(unittest.TestCase): class TestCookiesTxt(unittest.TestCase): - def test_load_cookiestxt(self): + def test_cookiestxt_load(self): def _assert(content, expected): - cookies = util.load_cookiestxt(io.StringIO(content, None)) - for c, e in zip(cookies, expected): + jar = http.cookiejar.CookieJar() + util.cookiestxt_load(io.StringIO(content, None), jar) + for c, e in zip(jar, expected): self.assertEqual(c.__dict__, e.__dict__) _assert("", []) @@ -218,13 +219,14 @@ class TestCookiesTxt(unittest.TestCase): ) with self.assertRaises(ValueError): - util.load_cookiestxt("example.org\tTRUE\t/\tTRUE\t0\tname") + util.cookiestxt_load("example.org\tTRUE\t/\tTRUE\t0\tname", + http.cookiejar.CookieJar()) - def test_save_cookiestxt(self): + def test_cookiestxt_store(self): def _assert(cookies, expected): fp = io.StringIO(newline=None) - util.save_cookiestxt(fp, cookies) + util.cookiestxt_store(fp, cookies) self.assertMultiLineEqual(fp.getvalue(), expected) _assert([], "# Netscape HTTP Cookie File\n\n") |
