Unanswered
Hi Caleb,
In your query object within the coreflow is where you would construct the request. In the example query below an xml string of <ExampleRequest>123456789</ExampleRequest> gets produced. The build() method is what's responsible for constructing whatever the shape is. I'd setup a test where you have your known good request string in a file (test these by hand and make sure they are what you expect), then in the test construct the query object and call the build() method which gets asserted to your known request string.
class GetEmailQuery(BaseQuery):
def __init__(self,
logger: logging.Logger,
customer_id: str,
mock_failure=False
):
self.customer_id = customer_id
super().__init__(logger)
def build(self) -> str:
"""
Constructs and returns the core request from a template and provided parameters.
"""
root = lxml.etree.Element('ExampleRequest')
root.text = self.customer_id
xml_as_bytes = lxml.etree.tostring(root)
return xml_as_bytes.decode('utf8')
16 Views
0
Answers
one year ago
one year ago
Are there any headers automatically added to a core request coming from a coreflow. I just want to make sure that the request is going to the proper url and has the necessary keys for access
— Caleb Evans one year ago