def __eq__(self, other): if type(self) != type(other): raise TypeError("Cannot compare %s with %s" % (type(self), type(other))) try: if not utils.is_zuuid(self.id) or not utils.is_zuuid(other.id): raise AttributeError() except AttributeError: raise ValueError('Both comparees should have a Zimbra UUID as "id" attribute') return self.id == other.id
def __eq__(self, other): if type(self) != type(other): raise TypeError('Cannot compare %s with %s' % (type(self), type(other))) try: if not utils.is_zuuid(self.id) or not utils.is_zuuid(other.id): raise AttributeError() except AttributeError: raise ValueError( 'Both comparees should have a Zimbra UUID as "id" attribute') return self.id == other.id
def test_create_signature_with_xml_content(self): sig_name = 'unittest' sig_content = ' ' sig = self.zc.create_signature(sig_name, sig_content) self.assertIsInstance(sig, Signature) self.assertTrue(utils.is_zuuid(sig.id)) self.assertEqual(sig.name, sig_name) return sig
def test_get_identities(self): identities = self.zc.get_identities() self.assertIsInstance(identities, list) self.assertIsInstance(identities[0], Identity) self.assertEqual(identities[0].name, 'DEFAULT') self.assertTrue(utils.is_zuuid(identities[0]['zimbraPrefIdentityId']))