def test_sendRest(self): try: client = AgateClient.buildWithAuthentication(server="%s:%s" % (self.SERVER, self.PORT), user='******', password='******') self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_validAuthLoginInfo(self): try: args = Namespace(agate="%s:%s" % (self.SERVER, self.PORT), user='******', password='******') client = AgateClient.build(loginInfo=AgateClient.LoginInfo.parse(args)) self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_validSslLoginInfo(self): try: args = Namespace(agate="%s:%s" % (self.SSL_SERVER, self.SSL_PORT), ssl_cert=self.SSL_CERTIFICATE, ssl_key=self.SSL_KEY) client = AgateClient.build(loginInfo=AgateClient.LoginInfo.parse(args)) self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_sendSecuredRest(self): try: client = AgateClient.buildWithCertificate(server="%s:%s" % (self.SSL_SERVER, self.SSL_PORT), cert=self.SSL_CERTIFICATE, key=self.SSL_KEY) self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_sendRestBadCredentials(self): client = AgateClient.buildWithAuthentication(server="%s:%s" % (self.SERVER, self.PORT), user='******', password='******') self.assertRaises(Exception, self.__sendSimpleRequest, client.new_request())
def test_sendRestBadServer(self): client = AgateClient.buildWithAuthentication( server='http://deadbeef:8081', user='******', password='******') self.assertRaises(Exception, self.__sendSimpleRequest, client.new_request())
def test_sendSecuredRest(self): try: client = AgateClient.buildWithCertificate( server="%s:%s" % (self.SSL_SERVER, self.SSL_PORT), cert=self.SSL_CERTIFICATE, key=self.SSL_KEY) self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_sendRest(self): try: client = AgateClient.buildWithAuthentication( server="%s:%s" % (self.SERVER, self.PORT), user='******', password='******') self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_validSslLoginInfo(self): try: args = Namespace(agate="%s:%s" % (self.SSL_SERVER, self.SSL_PORT), ssl_cert=self.SSL_CERTIFICATE, ssl_key=self.SSL_KEY) client = AgateClient.build( loginInfo=AgateClient.LoginInfo.parse(args)) self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_validAuthLoginInfo(self): try: args = Namespace(agate="%s:%s" % (self.SERVER, self.PORT), user='******', password='******') client = AgateClient.build( loginInfo=AgateClient.LoginInfo.parse(args)) self.__sendSimpleRequest(client.new_request()) except Exception, e: self.fail(e)
def test_sendRestBadServer(self): client = AgateClient.buildWithAuthentication(server='http://deadbeef:8081', user='******', password='******') self.assertRaises(Exception, self.__sendSimpleRequest, client.new_request())