コード例 #1
0
    def test_zz_execute(self):
        coll = BonnieCollector()

        notification = { 'uri': 'imap://[email protected]@kolab.example.org/Calendar;UID=3' }
        result = json.loads(coll.execute('FETCH', json.dumps(notification)))

        self.assertTrue(result.has_key('messageContent'))
        self.assertTrue(result.has_key('uidset'))
        self.assertEqual(result['uidset'], '3')

        notification['vnd.cmu.oldUidset'] = '3'
        result = json.loads(coll.execute('HEADER', json.dumps(notification)))
        self.assertTrue(result.has_key('messageHeaders'))

        result = json.loads(coll.execute('GETMETADATA', json.dumps(notification)))
        self.assertTrue(result.has_key('metadata'))

        result = json.loads(coll.execute('GETACL', json.dumps(notification)))
        self.assertTrue(result.has_key('acl'))