-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from KWB-R/dev
New release to fix bug due to changed column name
- Loading branch information
Showing
55 changed files
with
847 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview | ||
# * https://testthat.r-lib.org/articles/special-files.html | ||
|
||
library(testthat) | ||
library(wasserportal) | ||
|
||
test_check("wasserportal") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:33.492441. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("add_wasserportal_metadata() works", { | ||
|
||
expect_error( | ||
wasserportal:::add_wasserportal_metadata() | ||
# argument "x" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:44.744923. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("as_date_de() works", { | ||
|
||
expect_error( | ||
wasserportal:::as_date_de() | ||
# argument "x" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:44.744923. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("assert_date() works", { | ||
|
||
expect_error( | ||
wasserportal:::assert_date() | ||
# argument "x" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:46.168353. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("base_url_download() works", { | ||
|
||
result <- wasserportal:::base_url_download() | ||
|
||
expect_length(result, 1L) | ||
expect_type(result, "character") | ||
expect_true(startsWith(result, "https://")) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:33.492441. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("clean_timestamp_columns() works", { | ||
|
||
expect_error( | ||
wasserportal:::clean_timestamp_columns() | ||
# argument "data" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:44.744923. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("columns_to_labels() works", { | ||
|
||
expect_error( | ||
wasserportal:::columns_to_labels() | ||
# argument "columns" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:44.744923. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("date_string_de() works", { | ||
|
||
expect_error( | ||
wasserportal:::date_string_de() | ||
# argument "x" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:16.145095. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("extract_hrefs() works", { | ||
|
||
expect_error( | ||
wasserportal:::extract_hrefs() | ||
# argument "x" is missing, with no default | ||
) | ||
|
||
}) | ||
|
16 changes: 16 additions & 0 deletions
16
tests/testthat/test-function-get_daily_surfacewater_data.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:31.879282. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_daily_surfacewater_data() works", { | ||
|
||
expect_error( | ||
wasserportal:::get_daily_surfacewater_data() | ||
# argument "stations" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:38.376262. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_groundwater_data() works", { | ||
|
||
f <- wasserportal:::get_groundwater_data | ||
|
||
expect_error(f(debug = FALSE)) | ||
|
||
stations <- list( | ||
overview_list = list( | ||
groundwater.level = data.frame( | ||
Messstellennummer = 1 | ||
), | ||
groundwater.quality = data.frame( | ||
Messstellennummer = 1 | ||
) | ||
) | ||
) | ||
|
||
result <- f(stations, debug = FALSE) | ||
|
||
expect_length(result, 2L) | ||
expect_type(result, "list") | ||
|
||
expect_true(all( | ||
sapply(result, kwb.utils::mainClass) == "data.table" | ||
)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:38.376262. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_groundwater_options() works", { | ||
|
||
result <- wasserportal:::get_groundwater_options() | ||
|
||
expect_identical( | ||
names(result), | ||
c("groundwater.level", "groundwater.quality") | ||
) | ||
}) | ||
|
16 changes: 16 additions & 0 deletions
16
tests/testthat/test-function-get_non_external_station_ids.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:31.879282. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_non_external_station_ids() works", { | ||
|
||
expect_error( | ||
wasserportal:::get_non_external_station_ids() | ||
# argument "station_data" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:38.527944. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_overview_options() works", { | ||
|
||
result <- wasserportal:::get_overview_options() | ||
|
||
expect_identical( | ||
names(result), | ||
c("surface_water", "groundwater") | ||
) | ||
|
||
expect_true(all(sapply(result, is.list))) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:41.860028. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_station_variables() works", { | ||
|
||
expect_error( | ||
wasserportal:::get_station_variables() | ||
# argument "station_df" is missing, with no default | ||
) | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:01.710311. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_stations() works", { | ||
|
||
expect_output(result <- wasserportal:::get_stations()) | ||
|
||
expect_identical( | ||
names(result), | ||
c("overview_list", "overview_df", "crosstable") | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:09:31.879282. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_surfacewater_variables() works", { | ||
|
||
result <- wasserportal:::get_surfacewater_variables() | ||
|
||
expect_type(result, "character") | ||
|
||
expect_true(all(startsWith(names(result), "surface_water."))) | ||
|
||
}) |
16 changes: 16 additions & 0 deletions
16
tests/testthat/test-function-get_url_and_body_for_groundwater_data_download.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:43.430779. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_url_and_body_for_groundwater_data_download() works", { | ||
|
||
expect_error( | ||
wasserportal:::get_url_and_body_for_groundwater_data_download() | ||
# argument "stype" is missing, with no default | ||
) | ||
|
||
}) | ||
|
16 changes: 16 additions & 0 deletions
16
tests/testthat/test-function-get_wasserportal_master_data.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:07.960625. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_wasserportal_master_data() works", { | ||
|
||
expect_error( | ||
wasserportal:::get_wasserportal_master_data() | ||
# argument "master_url" is missing, with no default | ||
) | ||
|
||
}) | ||
|
16 changes: 16 additions & 0 deletions
16
tests/testthat/test-function-get_wasserportal_masters_data.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This test file has been generated by kwb.test::create_test_files() | ||
# launched by user hsonne on 2023-09-23 23:10:07.960625. | ||
# Your are strongly encouraged to modify the dummy functions | ||
# so that real cases are tested. You should then delete this comment. | ||
# | ||
|
||
test_that("get_wasserportal_masters_data() works", { | ||
|
||
expect_error( | ||
wasserportal:::get_wasserportal_masters_data() | ||
# argument "master_urls" is missing, with no default | ||
) | ||
|
||
}) | ||
|
Oops, something went wrong.