Beispiel #1
0
    def testZimbraClientNoAuth(self):

        zclient = ZimbraClient('')
        zclient.transport = MockTransport()
        zclient.authenticator = MockAuthenticator()

        self.assertRaises(AuthException, zclient.invoke, '', '', {})
Beispiel #2
0
    def testZimbraClientAuth(self):

        zclient = ZimbraClient('')
        zclient.transport = MockTransport()
        zclient.authenticator = MockAuthenticator()

        zclient.authenticate(self.account_name, self.password)
Beispiel #3
0
    def testZimbraClientWrongAuth(self):

        zclient = ZimbraClient('')
        zclient.transport = MockTransport()
        zclient.authenticator = MockAuthenticator()

        self.assertRaises(AuthException, zclient.authenticate,
                          self.account_name, 'wrong')
Beispiel #4
0
    def call():
        logging.basicConfig(stream=sys.stdout,level=logging.DEBUG)

        p = load_properties()

        zclient = ZimbraClient(soap.soap_url(p[pconstant.HOSTNAME]))
        zclient.authenticate(p[pconstant.ACCOUNT_NAME], p[pconstant.PASSWORD])

        return f(p, zclient)
Beispiel #5
0
    def testZimbraClientNoRequest(self):

        zclient = ZimbraClient('')
        zclient.transport = MockTransport()
        zclient.authenticator = MockAuthenticator()

        zclient.authenticate(self.account_name, self.password)

        self.assertRaises(ZimbraClientException, zclient.invoke, '', '', {})
Beispiel #6
0
    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)
Beispiel #7
0
    def call():
        logging.basicConfig(stream=sys.stdout,level=logging.DEBUG)

        p = load_properties()

        proxy_url = soap.proxy_url(p[pconstant.PROXY_HOSTNAME],
                                   p[pconstant.PROXY_USERNAME],
                                   p[pconstant.PROXY_PASSWORD],
                                   p[pconstant.PROXY_PORT],
                                   p[pconstant.PROXY_SCHEME])
    
        zclient = ZimbraClient(soap.soap_url(p[pconstant.HOSTNAME]),
                               proxy_url=proxy_url)
        zclient.authenticate(p[pconstant.ACCOUNT_NAME], p[pconstant.PASSWORD])

        return f(p, zclient)