Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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)
Exemple #5
0
    def test_sendRestBadCredentials(self):
        client = AgateClient.buildWithAuthentication(server="%s:%s" %
                                                     (self.SERVER, self.PORT),
                                                     user='******',
                                                     password='******')

        self.assertRaises(Exception, self.__sendSimpleRequest,
                          client.new_request())
Exemple #6
0
    def test_sendRestBadServer(self):
        client = AgateClient.buildWithAuthentication(
            server='http://deadbeef:8081',
            user='******',
            password='******')

        self.assertRaises(Exception, self.__sendSimpleRequest,
                          client.new_request())
Exemple #7
0
 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)
Exemple #8
0
 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)
Exemple #9
0
 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)
Exemple #10
0
 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)
Exemple #11
0
    def test_sendRestBadCredentials(self):
        client = AgateClient.buildWithAuthentication(server="%s:%s" % (self.SERVER, self.PORT), user='******',
                                                    password='******')

        self.assertRaises(Exception, self.__sendSimpleRequest, client.new_request())
Exemple #12
0
    def test_sendRestBadServer(self):
        client = AgateClient.buildWithAuthentication(server='http://deadbeef:8081', user='******',
                                                    password='******')

        self.assertRaises(Exception, self.__sendSimpleRequest, client.new_request())