I'm developing some API tests to a SOAP services. The class that performs the call to API is:class GetUserData(object):    status_code =     firstname =     lastname =     customer_id =     def do_request(self, user_id):        form =             <soapenv:Envelope>               <soapenv:Header/>               <soapenv:Body>                  ...                    <soapenv:Body>                </soapenv:Envelope>         % (user_id)        encoded_request = form.encode('utf-8')        requests.packages.urllib3.disable_warnings(InsecureRequestWarning)        response = requests.post(url=config.url, data=encoded_request, verify=False)        # Parse response        self.status_code = response.status_code        dict = xmltodict.parse(response.text)        item = dict['soap:Envelope']['soap:Body']['ns1:user']['return']        self.firstname = item['firstname']        self.lastname = item['lastname']        self.customer_id = item['customer_id']and using this class, the assertions are like:def assert_results(context, firstname, lastname):  get_user_data = GetUserData()  get_user_data.do_request(user_id)  assert_that(get_user_data.firstname, equal_to(firstname))  assert_that(get_user_data.lastname, equal_to(lastname))I'm wondering if instead of saving the result of the request in internal properties, I should do a static method and return an object that contains these values (something like UserDataResponse). Any idea?
Call and parse an API request
python;api;soap