Skip to content

Commit

Permalink
make paths portable :-) + fix tests (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored Apr 27, 2022
1 parent 9f46042 commit 6602959
Show file tree
Hide file tree
Showing 114 changed files with 1,076 additions and 457 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
with:
extra-packages: any::rcmdcheck
needs: check
cache-version: 3

- uses: r-lib/actions/check-r-package@v2
with:
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Suggests:
webmockr,
withr
Remotes:
eblondel/ows4R
eblondel/ows4R,
maelle/httptest@fix-requester-usage
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Expand Down
1 change: 1 addition & 0 deletions EMODnetWFS.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageCleanBeforeInstall: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
8 changes: 8 additions & 0 deletions inst/httptest/request.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
httptest::set_requester(function (request) {
httptest::gsub_request(
request,
"https://geo.vliz.be/geoserver/Emodnetbio/",
"api/",
fixed = TRUE
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ structure(list(url = "https://geo.vliz.be/geoserver/Emodnetbio/wfs?service=WFS&v
status_code = 200L, headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-DescribeFeatureType.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:14:37 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:11 GMT"), class = c("insensitive",
"list")), all_headers = list(list(status = 200L, version = "HTTP/1.1",
headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-DescribeFeatureType.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:14:37 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:11 GMT"), class = c("insensitive",
"list")))), cookies = structure(list(domain = logical(0),
flag = logical(0), path = logical(0), secure = logical(0),
expiration = structure(numeric(0), class = c("POSIXct",
"POSIXt")), name = logical(0), value = logical(0)), row.names = integer(0), class = "data.frame"),
content = charToRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xsd:schema xmlns:Emodnetbio=\"geo.vliz.be/Emodnetbio\" xmlns:gml=\"http://www.opengis.net/gml/3.2\" xmlns:wfs=\"http://www.opengis.net/wfs/2.0\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" targetNamespace=\"geo.vliz.be/Emodnetbio\">\n <xsd:import namespace=\"http://www.opengis.net/gml/3.2\" schemaLocation=\"http://geo.vliz.be:80/geoserver/schemas/gml/3.2.1/gml.xsd\"/>\n <xsd:complexType name=\"OOPS_metadataType\">\n <xsd:complexContent>\n <xsd:extension base=\"gml:AbstractFeatureType\">\n <xsd:sequence>\n <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"id\" nillable=\"false\" type=\"xsd:int\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"AphiaID\" nillable=\"true\" type=\"xsd:int\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"scientificName\" nillable=\"true\" type=\"xsd:string\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"startYearCollection\" nillable=\"true\" type=\"xsd:short\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"endYearCollection\" nillable=\"true\" type=\"xsd:short\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"season\" nillable=\"true\" type=\"xsd:short\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"measurementUnit\" nillable=\"true\" type=\"xsd:string\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"fileName\" nillable=\"true\" type=\"xsd:string\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"datasetID\" nillable=\"true\" type=\"xsd:int\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"uploadDate\" nillable=\"true\" type=\"xsd:dateTime\"/>\n </xsd:sequence>\n </xsd:extension>\n </xsd:complexContent>\n </xsd:complexType>\n <xsd:element name=\"OOPS_metadata\" substitutionGroup=\"gml:AbstractFeature\" type=\"Emodnetbio:OOPS_metadataType\"/>\n</xsd:schema>\n"),
date = structure(1649416477, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.9e-05,
connect = 4e-05, pretransfer = 0.000109, starttransfer = 0.034026,
total = 0.035079)), class = "response")
date = structure(1651041371, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 2.6e-05,
connect = 2.6e-05, pretransfer = 8.4e-05, starttransfer = 0.048052,
total = 0.048125)), class = "response")
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ structure(list(url = "https://geo.vliz.be/geoserver/Emodnetbio/wfs?service=WFS&v
status_code = 200L, headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-DescribeFeatureType.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:14:39 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:12 GMT"), class = c("insensitive",
"list")), all_headers = list(list(status = 200L, version = "HTTP/1.1",
headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-DescribeFeatureType.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:14:39 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:12 GMT"), class = c("insensitive",
"list")))), cookies = structure(list(domain = logical(0),
flag = logical(0), path = logical(0), secure = logical(0),
expiration = structure(numeric(0), class = c("POSIXct",
"POSIXt")), name = logical(0), value = logical(0)), row.names = integer(0), class = "data.frame"),
content = charToRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xsd:schema xmlns:Emodnetbio=\"geo.vliz.be/Emodnetbio\" xmlns:gml=\"http://www.opengis.net/gml/3.2\" xmlns:wfs=\"http://www.opengis.net/wfs/2.0\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" targetNamespace=\"geo.vliz.be/Emodnetbio\">\n <xsd:import namespace=\"http://www.opengis.net/gml/3.2\" schemaLocation=\"http://geo.vliz.be:80/geoserver/schemas/gml/3.2.1/gml.xsd\"/>\n <xsd:complexType name=\"mediseh_posidonia_nodataType\">\n <xsd:complexContent>\n <xsd:extension base=\"gml:AbstractFeatureType\">\n <xsd:sequence>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"id\" nillable=\"true\" type=\"xsd:int\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"km\" nillable=\"true\" type=\"xsd:decimal\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"the_geom\" nillable=\"true\" type=\"gml:MultiCurvePropertyType\"/>\n </xsd:sequence>\n </xsd:extension>\n </xsd:complexContent>\n </xsd:complexType>\n <xsd:element name=\"mediseh_posidonia_nodata\" substitutionGroup=\"gml:AbstractFeature\" type=\"Emodnetbio:mediseh_posidonia_nodataType\"/>\n</xsd:schema>\n"),
date = structure(1649416479, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.6e-05,
connect = 3.6e-05, pretransfer = 0.000104, starttransfer = 0.031447,
total = 0.032363)), class = "response")
date = structure(1651041372, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.1e-05,
connect = 3.2e-05, pretransfer = 0.000102, starttransfer = 0.047861,
total = 0.047948)), class = "response")
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ structure(list(url = "https://geo.vliz.be/geoserver/Emodnetbio/wfs?service=WFS&v
status_code = 200L, headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-GetFeature.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:14:39 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:13 GMT"), class = c("insensitive",
"list")), all_headers = list(list(status = 200L, version = "HTTP/1.1",
headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-GetFeature.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:14:39 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:13 GMT"), class = c("insensitive",
"list")))), cookies = structure(list(domain = logical(0),
flag = logical(0), path = logical(0), secure = logical(0),
expiration = structure(numeric(0), class = c("POSIXct",
"POSIXt")), name = logical(0), value = logical(0)), row.names = integer(0), class = "data.frame"),
content = charToRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?><wfs:FeatureCollection xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:Emodnetbio=\"geo.vliz.be/Emodnetbio\" xmlns:wfs=\"http://www.opengis.net/wfs/2.0\" xmlns:gml=\"http://www.opengis.net/gml/3.2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" numberMatched=\"3\" numberReturned=\"3\" timeStamp=\"2022-04-08T11:14:39.205Z\" xsi:schemaLocation=\"http://www.opengis.net/wfs/2.0 http://geo.vliz.be:80/geoserver/schemas/wfs/2.0/wfs.xsd geo.vliz.be/Emodnetbio http://geo.vliz.be:80/geoserver/Emodnetbio/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=Emodnetbio%3Amediseh_cymodocea_pnt http://www.opengis.net/gml/3.2 http://geo.vliz.be:80/geoserver/schemas/gml/3.2.1/gml.xsd\"><wfs:boundedBy><gml:Envelope><gml:lowerCorner>32.91777958700004 14.379386510410153</gml:lowerCorner><gml:upperCorner>35.988571738846716 35.075850495000054</gml:upperCorner></gml:Envelope></wfs:boundedBy><wfs:member><Emodnetbio:mediseh_cymodocea_pnt gml:id=\"mediseh_cymodocea_pnt.1160\"><gml:boundedBy><gml:Envelope srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:lowerCorner>32.91778 35.07585</gml:lowerCorner><gml:upperCorner>32.91778 35.07585</gml:upperCorner></gml:Envelope></gml:boundedBy><Emodnetbio:id>0</Emodnetbio:id><Emodnetbio:country>Israele</Emodnetbio:country><Emodnetbio:the_geom><gml:Point srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:pos>32.91778 35.07585</gml:pos></gml:Point></Emodnetbio:the_geom></Emodnetbio:mediseh_cymodocea_pnt></wfs:member><wfs:member><Emodnetbio:mediseh_cymodocea_pnt gml:id=\"mediseh_cymodocea_pnt.1264\"><gml:boundedBy><gml:Envelope srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:lowerCorner>35.953397 14.448711</gml:lowerCorner><gml:upperCorner>35.953397 14.448711</gml:upperCorner></gml:Envelope></gml:boundedBy><Emodnetbio:id>0</Emodnetbio:id><Emodnetbio:country>Malta</Emodnetbio:country><Emodnetbio:the_geom><gml:Point srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:pos>35.953397 14.448711</gml:pos></gml:Point></Emodnetbio:the_geom></Emodnetbio:mediseh_cymodocea_pnt></wfs:member><wfs:member><Emodnetbio:mediseh_cymodocea_pnt gml:id=\"mediseh_cymodocea_pnt.1265\"><gml:boundedBy><gml:Envelope srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:lowerCorner>35.988572 14.379387</gml:lowerCorner><gml:upperCorner>35.988572 14.379387</gml:upperCorner></gml:Envelope></gml:boundedBy><Emodnetbio:id>0</Emodnetbio:id><Emodnetbio:country>Malta</Emodnetbio:country><Emodnetbio:the_geom><gml:Point srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:pos>35.988572 14.379387</gml:pos></gml:Point></Emodnetbio:the_geom></Emodnetbio:mediseh_cymodocea_pnt></wfs:member></wfs:FeatureCollection>"),
date = structure(1649416479, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.6e-05,
connect = 3.6e-05, pretransfer = 0.000101, starttransfer = 0.074706,
total = 0.075428)), class = "response")
content = charToRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?><wfs:FeatureCollection xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:Emodnetbio=\"geo.vliz.be/Emodnetbio\" xmlns:wfs=\"http://www.opengis.net/wfs/2.0\" xmlns:gml=\"http://www.opengis.net/gml/3.2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" numberMatched=\"3\" numberReturned=\"3\" timeStamp=\"2022-04-27T06:36:13.940Z\" xsi:schemaLocation=\"http://www.opengis.net/wfs/2.0 http://geo.vliz.be:80/geoserver/schemas/wfs/2.0/wfs.xsd geo.vliz.be/Emodnetbio http://geo.vliz.be:80/geoserver/Emodnetbio/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=Emodnetbio%3Amediseh_cymodocea_pnt http://www.opengis.net/gml/3.2 http://geo.vliz.be:80/geoserver/schemas/gml/3.2.1/gml.xsd\"><wfs:boundedBy><gml:Envelope><gml:lowerCorner>32.91777958700004 14.379386510410153</gml:lowerCorner><gml:upperCorner>35.988571738846716 35.075850495000054</gml:upperCorner></gml:Envelope></wfs:boundedBy><wfs:member><Emodnetbio:mediseh_cymodocea_pnt gml:id=\"mediseh_cymodocea_pnt.1160\"><gml:boundedBy><gml:Envelope srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:lowerCorner>32.91778 35.07585</gml:lowerCorner><gml:upperCorner>32.91778 35.07585</gml:upperCorner></gml:Envelope></gml:boundedBy><Emodnetbio:id>0</Emodnetbio:id><Emodnetbio:country>Israele</Emodnetbio:country><Emodnetbio:the_geom><gml:Point srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:pos>32.91778 35.07585</gml:pos></gml:Point></Emodnetbio:the_geom></Emodnetbio:mediseh_cymodocea_pnt></wfs:member><wfs:member><Emodnetbio:mediseh_cymodocea_pnt gml:id=\"mediseh_cymodocea_pnt.1264\"><gml:boundedBy><gml:Envelope srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:lowerCorner>35.953397 14.448711</gml:lowerCorner><gml:upperCorner>35.953397 14.448711</gml:upperCorner></gml:Envelope></gml:boundedBy><Emodnetbio:id>0</Emodnetbio:id><Emodnetbio:country>Malta</Emodnetbio:country><Emodnetbio:the_geom><gml:Point srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:pos>35.953397 14.448711</gml:pos></gml:Point></Emodnetbio:the_geom></Emodnetbio:mediseh_cymodocea_pnt></wfs:member><wfs:member><Emodnetbio:mediseh_cymodocea_pnt gml:id=\"mediseh_cymodocea_pnt.1265\"><gml:boundedBy><gml:Envelope srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:lowerCorner>35.988572 14.379387</gml:lowerCorner><gml:upperCorner>35.988572 14.379387</gml:upperCorner></gml:Envelope></gml:boundedBy><Emodnetbio:id>0</Emodnetbio:id><Emodnetbio:country>Malta</Emodnetbio:country><Emodnetbio:the_geom><gml:Point srsName=\"urn:ogc:def:crs:EPSG::4326\" srsDimension=\"2\"><gml:pos>35.988572 14.379387</gml:pos></gml:Point></Emodnetbio:the_geom></Emodnetbio:mediseh_cymodocea_pnt></wfs:member></wfs:FeatureCollection>"),
date = structure(1651041373, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.2e-05,
connect = 3.2e-05, pretransfer = 0.000105, starttransfer = 0.345146,
total = 0.345452)), class = "response")
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ structure(list(url = "https://geo.vliz.be/geoserver/Emodnetbio/wfs?service=WFS&v
status_code = 200L, headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-DescribeFeatureType.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:16:37 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:10 GMT"), class = c("insensitive",
"list")), all_headers = list(list(status = 200L, version = "HTTP/1.1",
headers = structure(list(server = "Apache-Coyote/1.1",
`content-disposition` = "inline; filename=geoserver-DescribeFeatureType.text",
`content-encoding` = "gzip", `content-type` = "text/xml; subtype=gml/3.2",
`transfer-encoding` = "chunked", date = "Fri, 08 Apr 2022 11:16:37 GMT"), class = c("insensitive",
`transfer-encoding` = "chunked", date = "Wed, 27 Apr 2022 06:36:10 GMT"), class = c("insensitive",
"list")))), cookies = structure(list(domain = logical(0),
flag = logical(0), path = logical(0), secure = logical(0),
expiration = structure(numeric(0), class = c("POSIXct",
"POSIXt")), name = logical(0), value = logical(0)), row.names = integer(0), class = "data.frame"),
content = charToRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?><xsd:schema xmlns:Emodnetbio=\"geo.vliz.be/Emodnetbio\" xmlns:gml=\"http://www.opengis.net/gml/3.2\" xmlns:wfs=\"http://www.opengis.net/wfs/2.0\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" targetNamespace=\"geo.vliz.be/Emodnetbio\">\n <xsd:import namespace=\"http://www.opengis.net/gml/3.2\" schemaLocation=\"http://geo.vliz.be:80/geoserver/schemas/gml/3.2.1/gml.xsd\"/>\n <xsd:complexType name=\"mediseh_cor_abs_polyType\">\n <xsd:complexContent>\n <xsd:extension base=\"gml:AbstractFeatureType\">\n <xsd:sequence>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"area\" nillable=\"true\" type=\"xsd:double\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"perimeter\" nillable=\"true\" type=\"xsd:double\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"abspoldd_\" nillable=\"true\" type=\"xsd:double\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"abspoldd_i\" nillable=\"true\" type=\"xsd:double\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"the_geom\" nillable=\"true\" type=\"gml:MultiSurfacePropertyType\"/>\n </xsd:sequence>\n </xsd:extension>\n </xsd:complexContent>\n </xsd:complexType>\n <xsd:element name=\"mediseh_cor_abs_poly\" substitutionGroup=\"gml:AbstractFeature\" type=\"Emodnetbio:mediseh_cor_abs_polyType\"/>\n</xsd:schema>\n"),
date = structure(1649416597, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.8e-05,
connect = 3.8e-05, pretransfer = 0.000106, starttransfer = 0.03091,
total = 0.031514)), class = "response")
date = structure(1651041370, class = c("POSIXct", "POSIXt"
), tzone = "GMT"), times = c(redirect = 0, namelookup = 3.2e-05,
connect = 3.3e-05, pretransfer = 0.000127, starttransfer = 0.066026,
total = 0.067744)), class = "response")
Loading

0 comments on commit 6602959

Please sign in to comment.