Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Lib/test/test_imaplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2523,7 +2523,16 @@ def test_enable_raises_error_if_not_AUTH(self):
self.assertRaises(imaplib.IMAP4.error, client.enable, 'foo')
self.assertFalse(client.utf8_enabled)

# XXX Also need a test that enable after SELECT raises an error.
@threading_helper.reap_threads
def test_enable_raises_error_after_select(self):
with self.reaped_pair(self.UTF8Server) as (server, client):
typ, _ = client.authenticate('MYAUTH', lambda x: b'fake')
self.assertEqual(typ, 'OK')
typ, _ = client.select()
self.assertEqual(typ, 'OK')
self.assertFalse(client.utf8_enabled)
self.assertRaises(imaplib.IMAP4.error, client.enable, 'UTF8=ACCEPT')
self.assertFalse(client.utf8_enabled)

@threading_helper.reap_threads
def test_enable_raises_error_if_no_capability(self):
Expand Down
Loading