From 88e445307628910093e0299caf1bace7267166f6 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 5 Jul 2026 11:08:15 +0300 Subject: [PATCH] gh-66335: Test uppercase IMAP4 command names (GH-152876) (cherry picked from commit 3cd6b7406442ad976c6651b9fba6f078971cdf10) Co-authored-by: Serhiy Storchaka Co-authored-by: Milan Oberkirch Co-authored-by: Claude Opus 4.8 (1M context) --- Lib/test/test_imaplib.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 091769e98ef5233..55e5c9fe3a6ecfb 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -1725,6 +1725,16 @@ def test_xatom(self): self.assertEqual(data, [b'MYCOMMAND completed']) self.assertEqual(server.args, ['arg1', 'arg2']) + def test_uppercase_command_names(self): + client, server = self._setup(SimpleIMAPHandler) + client.login('user', 'pass') + self.assertEqual(client.CAPABILITY, client.capability) + self.assertEqual(client.SELECT, client.select) + typ, data = client.CAPABILITY() + self.assertEqual(typ, 'OK') + with self.assertRaises(AttributeError): + client.NONEXISTENT + def test_control_characters(self): client, _ = self._setup(SimpleIMAPHandler) for c0 in support.control_characters_c0():