summaryrefslogtreecommitdiff
path: root/Lib/test/test_http_cookies.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:50 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:50 -0800
commit3b0e4320092ac0504b6670cafaf0301b908c91fc (patch)
treed3be1b6b844d61763bb366fa21ceed475e5703fd /Lib/test/test_http_cookies.py
parentb2fa705fd3887c326e811c418469c784353027f4 (diff)
parentf687fbcd73c14dfcbe086eb5cd94b298f1e81e72 (diff)
downloadcpython-3b0e4320092ac0504b6670cafaf0301b908c91fc.tar.gz
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'Lib/test/test_http_cookies.py')
-rw-r--r--Lib/test/test_http_cookies.py22
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"')