From: Serhiy Storchaka Date: Sun, 5 Jul 2026 08:39:30 +0000 (+0300) Subject: [3.13] gh-66335: Test uppercase IMAP4 command names (GH-152876) (GH-153082) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94f46485d149e2a863d03763a353a48b09eeb69e;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-66335: Test uppercase IMAP4 command names (GH-152876) (GH-153082) (cherry picked from commit 3cd6b7406442ad976c6651b9fba6f078971cdf10) Co-authored-by: Milan Oberkirch Co-authored-by: Claude Opus 4.8 (1M context) --- diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index c613d699f085..bbd6f173c945 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -1616,6 +1616,16 @@ class NewIMAPTestsMixin: 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 + class NewIMAPTests(NewIMAPTestsMixin, unittest.TestCase): imap_class = imaplib.IMAP4