Skip to content

Commit 5dd619c

Browse files
author
John Waller
committed
fixing matching issue with occ_downoad_cache #748
1 parent 40f1985 commit 5dd619c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+118640
-1
lines changed

R/occ_download_user_dl.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ DownloadMatch <- R6::R6Class(
194194
check_matches = function() {
195195
assert(self$age, c("integer", "numeric"))
196196
self$preds <- self$preds[tolower(self$preds$status) == "succeeded", ]
197-
mtchs <- unclass(check_inputs(self$pred$request)) == self$preds$pred_str
197+
mtchs <- unclass(check_inputs(self$pred$request)) == gsub(",\"matchCase\":\"FALSE\"", "", self$preds$pred_str)
198198
if (!any(mtchs)) {
199199
self$output <- self$pred_match()
200200
} else {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
http_interactions:
2+
- request:
3+
method: delete
4+
uri: https://api.gbif.org/v1/occurrence/download/request/0030224-240506114902167
5+
body:
6+
encoding: ''
7+
string: ''
8+
headers:
9+
Accept-Encoding: gzip, deflate
10+
Accept: application/json, text/xml, application/xml, */*
11+
response:
12+
status:
13+
status_code: '204'
14+
message: No Content
15+
explanation: Request fulfilled, nothing follows
16+
headers:
17+
status: HTTP/1.1 204 No Content
18+
body:
19+
encoding: ''
20+
file: no
21+
string: ''
22+
recorded_at: 2024-09-20 15:29:32 GMT
23+
recorded_with: vcr/1.2.0, webmockr/0.9.0

tests/fixtures/occ_get.yml

Lines changed: 533 additions & 0 deletions
Large diffs are not rendered by default.

tests/fixtures/occ_get_other.yml

Lines changed: 245 additions & 0 deletions
Large diffs are not rendered by default.

tests/fixtures/occ_metadata.yml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
http_interactions:
2+
- request:
3+
method: get
4+
uri: https://api.gbif.org/v1/occurrence/search/catalogNumber?q=122&limit=5
5+
body:
6+
encoding: ''
7+
string: ''
8+
headers:
9+
Accept-Encoding: gzip, deflate
10+
Accept: application/json, text/xml, application/xml, */*
11+
response:
12+
status:
13+
status_code: '200'
14+
message: OK
15+
explanation: Request fulfilled, document follows
16+
headers:
17+
status: HTTP/1.1 200 OK
18+
content-type: application/json
19+
body:
20+
encoding: ''
21+
file: no
22+
string: '["122","122 (WSP iSOTYPE)","122 (WSP, isotype) San Martin, F. 8010S","122
23+
E10","122 F"]'
24+
recorded_at: 2024-09-20 15:35:07 GMT
25+
recorded_with: vcr/1.2.0, webmockr/0.9.0
26+
- request:
27+
method: get
28+
uri: https://api.gbif.org/v1/occurrence/search/collectionCode?q=12&limit=5
29+
body:
30+
encoding: ''
31+
string: ''
32+
headers:
33+
Accept-Encoding: gzip, deflate
34+
Accept: application/json, text/xml, application/xml, */*
35+
response:
36+
status:
37+
status_code: '200'
38+
message: OK
39+
explanation: Request fulfilled, document follows
40+
headers:
41+
status: HTTP/1.1 200 OK
42+
content-type: application/json
43+
body:
44+
encoding: ''
45+
file: no
46+
string: '["12","12-00","12-1","12-82","12-CF"]'
47+
recorded_at: 2024-09-20 15:35:07 GMT
48+
recorded_with: vcr/1.2.0, webmockr/0.9.0
49+
- request:
50+
method: get
51+
uri: https://api.gbif.org/v1/occurrence/search/institutionCode?q=GB&limit=5
52+
body:
53+
encoding: ''
54+
string: ''
55+
headers:
56+
Accept-Encoding: gzip, deflate
57+
Accept: application/json, text/xml, application/xml, */*
58+
response:
59+
status:
60+
status_code: '200'
61+
message: OK
62+
explanation: Request fulfilled, document follows
63+
headers:
64+
status: HTTP/1.1 200 OK
65+
content-type: application/json
66+
body:
67+
encoding: ''
68+
file: no
69+
string: '["GB","GB, GH, S","GB, US","GBA","GBAO"]'
70+
recorded_at: 2024-09-20 15:35:07 GMT
71+
recorded_with: vcr/1.2.0, webmockr/0.9.0
72+
- request:
73+
method: get
74+
uri: https://api.gbif.org/v1/occurrence/search/catalogNumber?q=122&limit=5
75+
body:
76+
encoding: ''
77+
string: ''
78+
headers:
79+
Accept-Encoding: gzip, deflate
80+
Accept: application/json, text/xml, application/xml, */*
81+
response:
82+
status:
83+
status_code: '200'
84+
message: OK
85+
explanation: Request fulfilled, document follows
86+
headers:
87+
status: HTTP/1.1 200 OK
88+
content-type: application/json
89+
body:
90+
encoding: ''
91+
file: no
92+
string: '["122","122 (WSP iSOTYPE)","122 (WSP, isotype) San Martin, F. 8010S","122
93+
E10","122 F"]'
94+
recorded_at: 2024-09-20 15:35:07 GMT
95+
recorded_with: vcr/1.2.0, webmockr/0.9.0
96+
- request:
97+
method: get
98+
uri: https://api.gbif.org/v1/occurrence/search/catalogNumber?q=122&limit=10
99+
body:
100+
encoding: ''
101+
string: ''
102+
headers:
103+
Accept-Encoding: gzip, deflate
104+
Accept: application/json, text/xml, application/xml, */*
105+
response:
106+
status:
107+
status_code: '200'
108+
message: OK
109+
explanation: Request fulfilled, document follows
110+
headers:
111+
status: HTTP/1.1 200 OK
112+
content-type: application/json
113+
body:
114+
encoding: ''
115+
file: no
116+
string: '["122","122 (WSP iSOTYPE)","122 (WSP, isotype) San Martin, F. 8010S","122
117+
E10","122 F","122 RMCA 16981-M-","122 a","122 cyl","122 tauschii","122(4165)"]'
118+
recorded_at: 2024-09-20 15:35:07 GMT
119+
recorded_with: vcr/1.2.0, webmockr/0.9.0
120+
- request:
121+
method: get
122+
uri: https://api.gbif.org/v1/occurrence/search/catalogNumber?q=122&limit=5
123+
body:
124+
encoding: ''
125+
string: ''
126+
headers:
127+
Accept-Encoding: gzip, deflate
128+
Accept: application/json, text/xml, application/xml, */*
129+
response:
130+
status:
131+
status_code: '200'
132+
message: OK
133+
explanation: Request fulfilled, document follows
134+
headers:
135+
status: HTTP/1.1 200 OK
136+
content-type: application/json
137+
body:
138+
encoding: ''
139+
file: no
140+
string: '["122","122 (WSP iSOTYPE)","122 (WSP, isotype) San Martin, F. 8010S","122
141+
E10","122 F"]'
142+
recorded_at: 2024-09-20 15:35:07 GMT
143+
recorded_with: vcr/1.2.0, webmockr/0.9.0
144+
- request:
145+
method: get
146+
uri: https://api.gbif.org/v1/occurrence/search/recordedBy?q=scott&limit=5
147+
body:
148+
encoding: ''
149+
string: ''
150+
headers:
151+
Accept-Encoding: gzip, deflate
152+
Accept: application/json, text/xml, application/xml, */*
153+
response:
154+
status:
155+
status_code: '200'
156+
message: OK
157+
explanation: Request fulfilled, document follows
158+
headers:
159+
status: HTTP/1.1 200 OK
160+
content-type: application/json
161+
body:
162+
encoding: ''
163+
file: no
164+
string: '["SCOTT","SCOTT SUSAN","SCOTT A","SCOTT AND DOUGLAS MOODY","SCOTT
165+
AND KING"]'
166+
recorded_at: 2024-09-20 15:35:07 GMT
167+
recorded_with: vcr/1.2.0, webmockr/0.9.0

0 commit comments

Comments
 (0)