Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tests for NULL tables/urls #54

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/testthat/test-eq_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ test_that("eq_data function output is appropriate", {
expect_s3_class(eq_data_summary(), "tbl")
})

#eq_df <- eq_data_bulletin(.year = 2018, .month = "January")
eq_df <- eq_data_bulletin(.year = 2018, .month = "January")
#eq_df <- eq_data_bulletin(.year = 2019, .month = "January")

# test_that("eq_data function output is appropriate", {
# expect_s3_class(eq_df, "tbl")
# })
test_that("eq_data function output is appropriate", {
expect_s3_class(eq_df, "tbl")
})
7 changes: 7 additions & 0 deletions tests/testthat/test-eq_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ test_that("get table function outputs are as expected", {
test_that("tables are of the correct structure", {
expect_vector(tab_list, size = 1)
})

test_that("eq_get_table works as expected", {
expect_null(eq_get_table("https://earthquake.phivolcs.dost.gov.ph/test"))
})



17 changes: 17 additions & 0 deletions tests/testthat/test-eq_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,20 @@ test_that("eq_process outputs are appropriate", {
)
)
})

df <- eq_get_tables() |>
c(list(NULL)) |>
eq_process_tables()

test_that("eq_process outputs are appropriate", {
expect_s3_class(df, "tbl")
expect_named(
df,
expected = c(
"date_time_retrieved", "date_time",
"latitude", "longitude",
"depth", "magnitude", "location"
)
)
})