Esempio n. 1
0
 def test_validAuthLoginInfo(self):
     try:
         args = Namespace(mica="%s:%s" % (self.SERVER, self.PORT), user='******', password='******')
         client = MicaClient.build(loginInfo=MicaClient.LoginInfo.parse(args))
         self.__sendSimpleRequest(client.new_request())
     except Exception, e:
         self.fail(e)
Esempio n. 2
0
 def test_sendRest(self):
     try:
         client = MicaClient.buildWithAuthentication(server="%s:%s" % (self.SERVER, self.PORT), user='******',
                                                     password='******')
         self.__sendSimpleRequest(client.new_request())
     except Exception, e:
         self.fail(e)
Esempio n. 3
0
 def test_validSslLoginInfo(self):
     try:
         args = Namespace(mica="%s:%s" % (self.SSL_SERVER, self.SSL_PORT), ssl_cert=self.SSL_CERTIFICATE,
                          ssl_key=self.SSL_KEY)
         client = MicaClient.build(loginInfo=MicaClient.LoginInfo.parse(args))
         self.__sendSimpleRequest(client.new_request())
     except Exception, e:
         self.fail(e)
Esempio n. 4
0
 def test_sendSecuredRest(self):
     try:
         client = MicaClient.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)
Esempio n. 5
0
    def test_sendRestBadCredentials(self):
        client = MicaClient.buildWithAuthentication(server="%s:%s" % (self.SERVER, self.PORT), user='******',
                                                    password='******')

        self.assertRaises(Exception, self.__sendSimpleRequest, client.new_request())
Esempio n. 6
0
    def test_sendRestBadServer(self):
        client = MicaClient.buildWithAuthentication(server='http://deadbeef:8080', user='******',
                                                    password='******')

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