@@ -6,6 +6,8 @@ fields <- c("uuid", "genus", "specificepithet", "data.dwc:occurrenceID")
6
6
7
7
test_that(" basic search, full results works" , {
8
8
testthat :: skip_on_cran()
9
+ testthat :: skip_if_offline()
10
+
9
11
df <- idig_search_records(rq = rq , limit = 6000 )
10
12
11
13
expect_that(df , is_a(" data.frame" ))
@@ -18,6 +20,8 @@ test_that("basic search, full results works", {
18
20
19
21
test_that(" limited results, custom fields works" , {
20
22
testthat :: skip_on_cran()
23
+ testthat :: skip_if_offline()
24
+
21
25
df <- idig_search_records(rq = rq , fields = fields , limit = 10 )
22
26
23
27
expect_true(nrow(df ) == 10 )
@@ -29,6 +33,7 @@ test_that("limited results, custom fields works", {
29
33
30
34
test_that(" offset works" , {
31
35
testthat :: skip_on_cran()
36
+ testthat :: skip_if_offline()
32
37
33
38
df <- idig_search_records(rq = rq , fields = fields , limit = 2 , offset = 0 )
34
39
second_uuid <- df [[" uuid" ]][[2 ]]
@@ -40,6 +45,8 @@ test_that("offset works", {
40
45
41
46
test_that(" sorting works" , {
42
47
testthat :: skip_on_cran()
48
+ testthat :: skip_if_offline()
49
+
43
50
df <- idig_search_records(rq = rq , fields = fields , limit = 1 )
44
51
45
52
expect_true(substr(df [[" uuid" ]], 1 , 2 ) == " 00" )
@@ -56,6 +63,7 @@ test_that("sorting works", {
56
63
57
64
test_that(" max items disabled is thrown for large queries" , {
58
65
testthat :: skip_on_cran()
66
+ testthat :: skip_if_offline()
59
67
60
68
expect_that(
61
69
df <- idig_search_records(rq = list (" country" = " united states" )),
@@ -65,6 +73,7 @@ test_that("max items disabled is thrown for large queries", {
65
73
66
74
test_that(" max items disabled is thrown for windows past 100k" , {
67
75
testthat :: skip_on_cran()
76
+ testthat :: skip_if_offline()
68
77
69
78
expect_that(
70
79
df <- idig_search_records(
@@ -77,6 +86,7 @@ test_that("max items disabled is thrown for windows past 100k", {
77
86
78
87
test_that(" can get the 100000th result" , {
79
88
testthat :: skip_on_cran()
89
+ testthat :: skip_if_offline()
80
90
81
91
df <- idig_search_records(
82
92
rq = list (" country" = " united states" ),
@@ -87,13 +97,17 @@ test_that("can get the 100000th result", {
87
97
88
98
test_that(" all fields returns a lot of fields" , {
89
99
testthat :: skip_on_cran()
100
+ testthat :: skip_if_offline()
101
+
90
102
df <- idig_search_records(rq = rq , fields = " all" , limit = 10 )
91
103
92
104
expect_true(ncol(df ) > 50 )
93
105
})
94
106
95
107
test_that(" empty results return empty df with correct columns" , {
96
108
testthat :: skip_on_cran()
109
+ testthat :: skip_if_offline()
110
+
97
111
df <- idig_search_records(rq = list (" uuid" = " nobodyhome" ), fields = fields )
98
112
99
113
expect_true(nrow(df ) == 0 )
@@ -102,6 +116,8 @@ test_that("empty results return empty df with correct columns", {
102
116
103
117
test_that(" geopoint and special fields are expanded or excluded as appropriate" , {
104
118
testthat :: skip_on_cran()
119
+ testthat :: skip_if_offline()
120
+
105
121
fields_special <- c(" uuid" , " geopoint" , " mediarecords" , " flags" , " recordids" )
106
122
df <- idig_search_records(
107
123
rq = list (" uuid" = " f84faea8-82ac-4f71-b256-6b2be5d1b59d" ),
0 commit comments