File tree Expand file tree Collapse file tree 2 files changed +30
-21
lines changed Expand file tree Collapse file tree 2 files changed +30
-21
lines changed Original file line number Diff line number Diff line change 1
1
library(testthat )
2
+ library(httr )
2
3
library(isoWater )
3
4
4
5
test_check(" isoWater" )
Original file line number Diff line number Diff line change 1
- p = wiDB_values(" projects" )
2
-
3
- test_that(" wiDB_values works" , {
4
- expect_type(p , " list" )
5
- expect_length(p , 1 )
6
- })
7
-
8
- p = wiDB_sites(minDate = " 2020-09-01" , types = " Tap" )
9
-
10
- test_that(" wiDB_sites works" , {
11
- expect_s3_class(p , " data.frame" )
12
- expect_gte(nrow(p ), 2 )
13
- })
14
-
15
- p = wiDB_data(minDate = " 1990-01-01" , maxDate = " 1990-02-01" ,
16
- countries = " US" , types = " Precipitation" )
17
-
18
- test_that(" wiDB_data works" , {
19
- expect_type(p , " list" )
20
- expect_length(p , 2 )
21
- })
1
+ if (curl :: has_internet()){
2
+ p = wiDB_values(" projects" )
3
+
4
+ if (! is.null(p )){
5
+ test_that(" wiDB_values works" , {
6
+ expect_type(p , " list" )
7
+ expect_length(p , 1 )
8
+ })
9
+ }
10
+
11
+ p = wiDB_sites(minDate = " 2020-09-01" , types = " Tap" )
12
+
13
+ if (! is.null(p )){
14
+ test_that(" wiDB_sites works" , {
15
+ expect_s3_class(p , " data.frame" )
16
+ expect_gte(nrow(p ), 2 )
17
+ })
18
+ }
19
+
20
+ p = wiDB_data(minDate = " 1990-01-01" , maxDate = " 1990-02-01" ,
21
+ countries = " US" , types = " Precipitation" )
22
+
23
+ if (! is.null(p )){
24
+ test_that(" wiDB_data works" , {
25
+ expect_type(p , " list" )
26
+ expect_length(p , 2 )
27
+ })
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments