add a null check before using attrib#978
Conversation
add a null check before using attrib
|
@pvgenuchten - I've added a test for this update based on the XML responses from the live server. Tests fail without your update, and pass with it. The PR was previously failing due to an unrelated reason (fixed in #982). @tomkralidis - as discussed at #971 (comment) the test uses https://pytest-httpserver.readthedocs.io/ which allows request to be made by OWSLib, but using a mock server that can be configured to return XML from a saved file. It should be possible to run these in offline mode too (allowing only access to localhost) with a wrapper function in a conftest.py file - this can be addressed in a future PR. There is already a similar approach in OWSLib of loading XML from a file, for example: OWSLib/tests/test_iso3_parsing.py Line 302 in 39ad5a9 The advantage of https://pytest-httpserver.readthedocs.io/ is that it allows for testing of classes that don't allow XML to be passed in directly, and allows for end-to-end testing. Let me know your thoughts. |
|
Thanx for adding a test Seth |
Thanks for the info @geographika. I think this would be a valuable update to our testing. Feel free to open a dedicated issue so we can plan (and maybe split up the work if needed). |
resolves issue #973