-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced OGC reader #2191
Enhanced OGC reader #2191
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,3 +70,17 @@ def test_wfs(): | |
edgecolor='red') | ||
ax.add_feature(feature) | ||
return ax.figure | ||
|
||
|
||
@pytest.mark.network | ||
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.') | ||
@pytest.mark.xfail(raises=ParseError, | ||
reason="Bad XML returned from the URL") | ||
@pytest.mark.mpl_image_compare(filename='wfs_france.png') | ||
def test_wfs_france(): | ||
ax = plt.axes(projection=ccrs.epsg(2154)) | ||
url = 'https://agroenvgeo.data.inra.fr:443/geoserver/wfs' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if it would be beneficial for us to start mocking servers rather than relying on external sources? Basically, if it'd be reasonable to add both the XML you download from there and the image to the repository and then make a Mock response from that url. Then we wouldn't need these network marks anymore. This doesn't have to be undertaken here, it is more me just wondering how reliable these external servers are and if there is a way around hitting them constantly if they don't like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could use vcrpy to record and playback http traffic. That would be a low-cost way to "mock" it without questioning whether there's value in having the mock. It gets messy since the only true measure of "works" is "does it communicate with this resources that's outside our control". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pytest plugin for VCR looks like an easy solution. However, I leave this to the main developers because it adds new dependencies to cartopy testing. |
||
typename = 'collectif:t_ser_l93' | ||
feature = cfeature.WFSFeature(url, typename, edgecolor='red') | ||
ax.add_feature(feature) | ||
return ax.figure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the warning we are ignoring? We should at least mention why this is here with a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a UserWarning from .to_dict() from proj because the dict does not give all details of each projection. But we only check for the units here.
I added a comment.