示例#1
0
 def test_check_command_status(self):
     self.assertIsNone(utils.check_command_status(('EXP', 'command_result_data'), MailboxCopyError, expected='EXP'))
     self.assertIsNone(utils.check_command_status(('OK', 'res'), UnexpectedCommandStatusError))
     with self.assertRaises(TypeError):
         self.assertFalse(utils.check_command_status(('NOT_OK', 'test'), ImapToolsError))
     with self.assertRaises(MailboxCopyError):
         self.assertFalse(utils.check_command_status(('BYE', ''), MailboxCopyError, expected='OK'))
示例#2
0
 def test_check_command_status(self):
     self.assertIsNone(
         utils.check_command_status('box.fetch',
                                    ('EXP', 'command_result_data'),
                                    expected='EXP'))
     self.assertIsNone(utils.check_command_status('test', ('OK', 'res')))
     with self.assertRaises(utils.UnexpectedCommandStatusError):
         self.assertFalse(
             utils.check_command_status('test', ('NOT_OK', 'test')))
     with self.assertRaises(utils.UnexpectedCommandStatusError):
         self.assertFalse(
             utils.check_command_status('box.logout', ('BYE', ''), 'OK'))