summaryrefslogtreecommitdiff
path: root/Lib/test/test_imaplib.py
diff options
context:
space:
mode:
authorSanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>2020-06-02 06:47:45 +0530
committerGitHub <noreply@github.com>2020-06-02 03:17:45 +0200
commit8a3d2af997e3702eac4c5b012537be39ada36888 (patch)
tree4dd5ab95ff423850adce57db91b67560503c1e01 /Lib/test/test_imaplib.py
parentfe5dd78182dbf4937bcc2b113ca7526bfad0192b (diff)
downloadcpython-git-8a3d2af997e3702eac4c5b012537be39ada36888.tar.gz
bpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206)
Diffstat (limited to 'Lib/test/test_imaplib.py')
-rw-r--r--Lib/test/test_imaplib.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 0fcc1fb99a..f93efba794 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -933,6 +933,20 @@ class ThreadedNetworkedTests(unittest.TestCase):
self.assertIsNone(server.logged)
self.assertIsNone(server.logged)
+ @threading_helper.reap_threads
+ @cpython_only
+ def test_dump_ur(self):
+ # See: http://bugs.python.org/issue26543
+ untagged_resp_dict = {'READ-WRITE': [b'']}
+
+ with self.reaped_server(SimpleIMAPHandler) as server:
+ with self.imap_class(*server.server_address) as imap:
+ with mock.patch.object(imap, '_mesg') as mock_mesg:
+ imap._dump_ur(untagged_resp_dict)
+ mock_mesg.assert_called_with(
+ "untagged responses dump:READ-WRITE: [b'']"
+ )
+
@unittest.skipUnless(ssl, "SSL not available")
class ThreadedNetworkedTestsSSL(ThreadedNetworkedTests):