def testZimbraClientNoAuth(self): zclient = ZimbraClient('') zclient.transport = MockTransport() zclient.authenticator = MockAuthenticator() self.assertRaises(AuthException, zclient.invoke, '', '', {})
def testZimbraClientAuth(self): zclient = ZimbraClient('') zclient.transport = MockTransport() zclient.authenticator = MockAuthenticator() zclient.authenticate(self.account_name, self.password)
def testZimbraClientWrongAuth(self): zclient = ZimbraClient('') zclient.transport = MockTransport() zclient.authenticator = MockAuthenticator() self.assertRaises(AuthException, zclient.authenticate, self.account_name, 'wrong')
def testZimbraClientNoRequest(self): zclient = ZimbraClient('') zclient.transport = MockTransport() zclient.authenticator = MockAuthenticator() zclient.authenticate(self.account_name, self.password) self.assertRaises(ZimbraClientException, zclient.invoke, '', '', {})
def testZimbraClientRequest(self): zclient = ZimbraClient('') zclient.transport = MockTransport() zclient.authenticator = MockAuthenticator() zclient.authenticate(self.account_name, self.password) params = {} res = zclient.invoke(zconstant.NS_ZIMBRA_ACC_URL, sconstant.GetInfoRequest, params) self.assertEqual(self.account_name, res.name)