]> granicus.if.org Git - python/commitdiff
#10839: add new test file that was omitted from checkin
authorR David Murray <rdmurray@bitdance.com>
Tue, 29 May 2012 16:31:11 +0000 (12:31 -0400)
committerR David Murray <rdmurray@bitdance.com>
Tue, 29 May 2012 16:31:11 +0000 (12:31 -0400)
Lib/test/test_email/test_message.py [new file with mode: 0644]

diff --git a/Lib/test/test_email/test_message.py b/Lib/test/test_email/test_message.py
new file mode 100644 (file)
index 0000000..8cc3f80
--- /dev/null
@@ -0,0 +1,18 @@
+import unittest
+from email import policy
+from test.test_email import TestEmailBase
+
+
+class Test(TestEmailBase):
+
+    policy = policy.default
+
+    def test_error_on_setitem_if_max_count_exceeded(self):
+        m = self._str_msg("")
+        m['To'] = 'abc@xyz'
+        with self.assertRaises(ValueError):
+            m['To'] = 'xyz@abc'
+
+
+if __name__ == '__main__':
+    unittest.main()