23maverick23/oaxmlapi

Review Travis CI builds

Opened this issue · 1 comments

Travis CI builds for 2.7 and 3.5 are failing for two reasons:

  1. String comparisons of tostring() and prettify()

There doesn't seem to be a reliable way to compare XML strings with multiple elements across python versions as the elements can be in a random order.

  1. IsInstance() comparisons

This might not even be a necessary test, so look into this

xml_req = connections.Request(app, auth, xml_data).tostring()
Above line is giving error as below :
TypeError: can only concatenate str (not "bytes") to str
I am using Py 3.9 how should I proceed ? If I remove tostring from xml_req then I get the below error
TypeError: message_body should be a bytes-like object or an iterable, got <class 'oaxmlapi.connections.Request'>
My code that I used is as below to convert 2.7 to 3
req = urllib.request.Request(url='Url Path', data=xml_req)
response = urllib.request.urlopen(req)
html = response.read()
print(html)

Any thoughts ?