Skip to content

Commit

Permalink
limit testing for now
Browse files Browse the repository at this point in the history
  • Loading branch information
khufkens committed Jun 25, 2024
1 parent b51099b commit 0aecc26
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions tests/testthat/test_formatting_functions.R
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
# test formatting functions

# test all data downloads
test_that("test downloading functions",{

# NPN data
expect_message(
pr_dl_npn(species = 3,
internal = FALSE,
start = "2001-01-01",
end = "2001-12-31")
)

expect_error(
pr_dl_npn(species = 3,
internal = FALSE,
start = "2000-01-01",
end = "2000-12-31")
)

df <- pr_dl_npn(species = 3,
internal = TRUE,
start = "2001-01-01",
end = "2001-12-31")

expect_type(df,"list")

})
# test_that("test downloading functions",{
#
# # NPN data
# expect_message(
# pr_dl_npn(species = 3,
# internal = FALSE,
# start = "2001-01-01",
# end = "2001-12-31")
# )
#
# expect_error(
# pr_dl_npn(species = 3,
# internal = FALSE,
# start = "2000-01-01",
# end = "2000-12-31")
# )
#
# df <- pr_dl_npn(species = 3,
# internal = TRUE,
# start = "2001-01-01",
# end = "2001-12-31")
#
# expect_type(df,"list")
#
# })

test_that("test formatting functions",{

df <- pr_dl_npn(
species = 3,
internal = TRUE,
start = "2001-01-01",
end = "2001-12-31"
)

df <- pr_fm_npn(df)

expect_type(df,"list")
# df <- pr_dl_npn(
# species = 3,
# internal = TRUE,
# start = "2001-01-01",
# end = "2001-12-31"
# )
#
# df <- pr_fm_npn(df)
#
# expect_type(df,"list")

# check npn meta-data function
expect_output(check_npn_phenophases(list = TRUE))
l <- check_npn_phenophases(phenophase = 61, list = FALSE)
expect_type(l,"logical")
expect_output(check_npn_phenophases(phenophase = 61, list = TRUE))
l <- check_npn_species(species = 3, list = TRUE)
expect_type(l,"list")
l <- check_npn_species(list = TRUE)
expect_type(l,"list")
# expect_output(check_npn_phenophases(list = TRUE))
# l <- check_npn_phenophases(phenophase = 61, list = FALSE)
# expect_type(l,"logical")
# expect_output(check_npn_phenophases(phenophase = 61, list = TRUE))
# l <- check_npn_species(species = 3, list = TRUE)
# expect_type(l,"list")
# l <- check_npn_species(list = TRUE)
# expect_type(l,"list")

# csv data
f <- data.frame(
Expand All @@ -57,7 +57,8 @@ test_that("test formatting functions",{
lon = -110,
phenophase = "spring",
year = 2000,
doy = 120)
doy = 120
)

t <- tempfile()
write.table(
Expand All @@ -66,11 +67,12 @@ test_that("test formatting functions",{
row.names = FALSE,
col.names = TRUE,
quote = FALSE,
sep = ",")
sep = ","
)

# format data
npn_data <- pr_fm_csv(t, phenophase = "spring")
expect_type(npn_data, "list")
# format CSV data
csv_data <- pr_fm_csv(t, phenophase = "spring")
expect_type(csv_data, "list")

# phenocam formatting
phenocam_data <- pr_fm_phenocam(path = system.file(
Expand All @@ -79,6 +81,4 @@ test_that("test formatting functions",{
mustWork = TRUE))
expect_type(phenocam_data, "list")

# MODISTools formatting?

})

0 comments on commit 0aecc26

Please sign in to comment.