diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index d3e06a4..f74ab98 100644 --- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -92,6 +92,15 @@ class CookieTests(unittest.TestCase): """) + def test_load_accepts_a_binary_string(self): + C = cookies.SimpleCookie() + C.load(b'foo=bar') + self.assertEqual(C.output(), 'foo=bar') + + def test_load_rejects_a_text_string(self): + C = cookies.SimpleCookie() + self.assertRaises(TypeError, C.load, 'foo=bar') + def test_extended_encode(self): # Issue 9824: some browsers don't follow the standard; we now # encode , and ; to keep them from tripping up.