]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-66335: Test uppercase IMAP4 command names (GH-152876)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 5 Jul 2026 08:08:15 +0000 (11:08 +0300)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2026 08:08:15 +0000 (11:08 +0300)
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 5d9ca170ea59fdacb99708ece766cea08d155440..cdc2f9c8d852322f7782ff0669600f14d73370fd 100644 (file)
@@ -1740,6 +1740,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():