From 79fb9cf2eac7b328873ff30c7e6f9f7d96f89939 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 2 Jul 2026 14:05:11 +0300 Subject: [PATCH] gh-66335: Test uppercase IMAP4 command names 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 e797a625014603..74e9a162eaa8b2 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -1415,6 +1415,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():