def setUp(self):
        """Prepare unittest."""
        print self.id()
        if not self.__class__.service:
            self.__class__.service = client.GetLoginService(
                self.__class__.SERVER, self.__class__.VERSION, HTTP_PROXY)

        if self.__class__.test_super_user:
            if self.__class__.user_to_impersonate == '0':
                user_service = client.GetUserService(self.__class__.SERVER,
                                                     self.__class__.VERSION,
                                                     HTTP_PROXY)
                search_criteria = {'activeFilter': {'activeOnly': 'true'}}
                self.__class__.user_to_impersonate = user_service.GetUsersByCriteria(
                    search_criteria)[0]['records'][0]['id']

            if self.__class__.network_to_impersonate == '0':
                user_service = client.GetUserService(self.__class__.SERVER,
                                                     self.__class__.VERSION,
                                                     HTTP_PROXY)
                search_criteria = {'searchString': client._headers['Username']}
                self.__class__.network_to_impersonate = user_service.GetUsersByCriteria(
                    search_criteria)[0]['records'][0]['networkId']
Ejemplo n.º 2
0
    def setUp(self):
        """Prepare unittest."""
        print self.id()
        if not self.__class__.service:
            self.__class__.service = client.GetSubnetworkService(
                self.__class__.SERVER, self.__class__.VERSION, HTTP_PROXY)

        if self.__class__.user_self is None:
            user_service = client.GetUserService(self.__class__.SERVER,
                                                 self.__class__.VERSION,
                                                 HTTP_PROXY)
            search_criteria = {'searchString': client._headers['Username']}
            self.__class__.user_self = user_service.GetUsersByCriteria(
                search_criteria)[0]['records'][0]
 def setUp(self):
     """Prepare unittest."""
     print self.id()
     if not self.__class__.service:
         self.__class__.service = client.GetUserService(
             self.__class__.SERVER, self.__class__.VERSION, HTTP_PROXY)