Ejemplo n.º 1
0
 def verify_server_information(self, name):
     if self._response:
         jsonRe = self._response.json()
         logger.info("name: " + jsonRe['data']['name'])
         Assert.should_be_equal(jsonRe['data']['name'], name,
                                "Actuality is" + jsonRe['data']['name'],
                                "Expectation is " + name)
Ejemplo n.º 2
0
 def check_status_list_server(self):
     if self._response:
         logger.info("status_code: " + str(self._response.status_code))
         Assert.should_be_equal_as_integers(
             200, self._response.status_code,
             "Actuality is" + str(self._response.status_code),
             "Expectation is " + str(200))
Ejemplo n.º 3
0
    def update_network_configuration_hostname(self, number, hostname):
        requestData = {"hostName": hostname}
        requestData = json.dumps(requestData)

        headers = self._make_header({'Content-Type': 'application/json'})
        logger.info("Request data: " + requestData)
        resp = self.client.put(self.basedPath + "/" + number,
                               headers=headers,
                               data=requestData)
        return resp
 def verify_list_network_configuration_information(self,
                                                   count=None,
                                                   uri=None,
                                                   hostname=None):
     if self._response:
         netwRespond = self._response.json()
         lstNetWork = self.getlstItem(netwRespond['items'])
         dataJson = dataObject(json.dumps(lstNetWork[0].data))
         logger.info("count: " + str(netwRespond['count']))
         logger.info("uri: " + lstNetWork[0].uri)
         logger.info("dataJson.hostName" + dataJson.hostName)
         if count:
             Assert.should_be_equal_as_integers(netwRespond['count'], count)
         if uri:
             Assert.should_be_equal(lstNetWork[0].uri, uri)
         if hostname:
             Assert.should_be_equal(dataJson.hostName, hostname)
Ejemplo n.º 5
0
 def get_list_server(self):
     self._response = self.client.get(self.basedPath,
                                      headers=self._make_header())
     logger.info("respond: " + json.dumps(self._response.json()))
     return self._response
Ejemplo n.º 6
0
 def __init__(self):
     KratosAPIBase.__init__(self)
     self.basedPath = get_endpoint_api(self)
     logger.info("basedPath: " + str(self.basedPath))
     self._serverObject = load_data_for_apis(self)
     self._response = ""
 def get_network_configuration(self, number):
     self._response = self.client.get(self._basePath + "/" + number,
                                      headers=self._make_header())
     logger.info("respond json: " + json.dumps(self._response.json()))
     return self._response