]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-66335: Test uppercase IMAP4 command names (GH-152876) (GH-153080)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 5 Jul 2026 08:40:12 +0000 (10:40 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2026 08:40:12 +0000 (08:40 +0000)
(cherry picked from commit 3cd6b7406442ad976c6651b9fba6f078971cdf10)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Milan Oberkirch <zvyn@oberkirch.org>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lib/test/test_imaplib.py

index 091769e98ef5233eddbcec6f47075e796d052ecc..55e5c9fe3a6ecfb0bd348b15922e580e54440df1 100644 (file)
@@ -1725,6 +1725,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
+
     def test_control_characters(self):
         client, _ = self._setup(SimpleIMAPHandler)
         for c0 in support.control_characters_c0():