diff options
author | Mariatta Wijaya <mariatta.wijaya@gmail.com> | 2017-02-06 20:18:39 -0800 |
---|---|---|
committer | Mariatta Wijaya <mariatta.wijaya@gmail.com> | 2017-02-06 20:18:39 -0800 |
commit | 731cca110f376cdbaffb536e42d6c9d6da574fa8 (patch) | |
tree | 9cb95caf6f8b933115820bf699725d9cd600d2df /Lib/test/test_http_cookies.py | |
parent | da79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (diff) | |
parent | c8102f4d974669f4c5e4ca7bcd73292a1ac5bcbf (diff) | |
download | cpython-731cca110f376cdbaffb536e42d6c9d6da574fa8.tar.gz |
Issue #29371: merge with 3.6
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 2432e0bf53..ca21476da6 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"') |