diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-13 07:23:15 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-13 07:23:15 (GMT) |
commit | cc283378d65e8294895eead78815f8cda15653f5 (patch) | |
tree | c1d6c0768a57d75807a35e24083c9b354339ef6d /Lib/test/test_http_cookies.py | |
parent | 009b0a1face9c16b608b3cd18df8c88632006ae1 (diff) | |
download | cpython-cc283378d65e8294895eead78815f8cda15653f5.zip cpython-cc283378d65e8294895eead78815f8cda15653f5.tar.gz cpython-cc283378d65e8294895eead78815f8cda15653f5.tar.bz2 |
Issue #29192: Removed deprecated features in the http.cookies module.
Diffstat (limited to 'Lib/test/test_http_cookies.py')
-rw-r--r-- | Lib/test/test_http_cookies.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index 2432e0b..ca21476 100644 --- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -9,15 +9,6 @@ import warnings class CookieTests(unittest.TestCase): - def setUp(self): - self._warnings_manager = check_warnings() - self._warnings_manager.__enter__() - warnings.filterwarnings("ignore", ".* class is insecure.*", - DeprecationWarning) - - def tearDown(self): - self._warnings_manager.__exit__(None, None, None) - def test_basic(self): cases = [ {'data': 'chips=ahoy; vienna=finger', @@ -256,6 +247,9 @@ class MorselTests(unittest.TestCase): # Check output and js_output. M['path'] = '/foo' # Try a reserved key as well M.set(i, "%s_val" % i, "%s_coded_val" % i) + self.assertEqual(M.key, i) + self.assertEqual(M.value, "%s_val" % i) + self.assertEqual(M.coded_value, "%s_coded_val" % i) self.assertEqual( M.output(), "Set-Cookie: %s=%s; Path=/foo" % (i, "%s_coded_val" % i)) @@ -272,16 +266,14 @@ class MorselTests(unittest.TestCase): self.assertRaises(cookies.CookieError, M.set, i, '%s_value' % i, '%s_value' % i) - def test_deprecation(self): + def test_set_properties(self): morsel = cookies.Morsel() - with self.assertWarnsRegex(DeprecationWarning, r'\bkey\b'): + with self.assertRaises(AttributeError): morsel.key = '' - with self.assertWarnsRegex(DeprecationWarning, r'\bvalue\b'): + with self.assertRaises(AttributeError): morsel.value = '' - with self.assertWarnsRegex(DeprecationWarning, r'\bcoded_value\b'): + with self.assertRaises(AttributeError): morsel.coded_value = '' - with self.assertWarnsRegex(DeprecationWarning, r'\bLegalChars\b'): - morsel.set('key', 'value', 'coded_value', LegalChars='.*') def test_eq(self): base_case = ('key', 'value', '"value"') |