Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_uid_with_illegal_command(self):
imap_client = yield from self.login_user('user', 'pass', select=True)
for command in {'COPY', 'FETCH', 'STORE'}.symmetric_difference(Commands.keys()):
with self.assertRaises(aioimaplib.Abort) as expected:
yield from imap_client.uid(command)
self.assertEqual(expected.exception.args,
('command UID only possible with COPY, FETCH or STORE (was %s)' % command,))