]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-66335: Test uppercase IMAP4 command names (GH-152876) (GH-153081)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 5 Jul 2026 08:42:33 +0000 (11:42 +0300)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2026 08:42:33 +0000 (08:42 +0000)
(cherry picked from commit 3cd6b7406442ad976c6651b9fba6f078971cdf10)

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 7bab5f5bcb02bc7f70c2d4d35b8f4fe3d2d6bd4b..febedd4b325a182c7e48eb977b3421b570ba352a 100644 (file)
@@ -1731,6 +1731,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
+
     # property tests
 
     def test_file_property_should_not_be_accessed(self):