Skip to content

Commit

Permalink
update test files to new test location
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyclements committed May 22, 2024
1 parent 3e27533 commit f61fcc3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions R/crop_success_probabilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ crop_success_probabilities <- function(country,
paste0(station_id, ".", get_summaries[[2]]))
}
} else {
print("ye")

definitions <- epicsawrap::definitions(country = country, station_id = station_id, summaries = "crops_success")

print("good")

# Fetch daily data and preprocess
daily <- epicsadata::get_daily_data(country = country, station_id = station_id)

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-crop_success_probabilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ library(testthat)
# Test case 1
epicsadata::gcs_auth_file(file = "testdata/epicsa_token.json")
test_1_results <- readRDS("testdata/crop_success_probabilities_test_1.rds")
country <- "zm"
station_id <- "test_1"
country <- "zm_test"
station_id <- "r_data_test_1"

test_that("Correct summaries are called", {
result <- suppressWarnings(crop_success_probabilities(country, station_id))
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-total_temperature_summaries.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ library(testthat)
epicsadata::gcs_auth_file(file = "testdata/epicsa_token.json")
test_1_annual <- readRDS("testdata/annual_temperature_summaries_test_1.rds")
test_1_monthly <- readRDS("testdata/monthly_temperature_summaries_test_1.rds")
country <- "zm"
station_id <- "test_1"
country <- "zm_test"
station_id <- "r_data_test_1"

test_that("Correct summaries are called", {
result_annual <- suppressWarnings(annual_temperature_summaries(country, station_id, summaries = c("mean_tmin", "mean_tmax")))
Expand All @@ -28,4 +28,4 @@ test_that("Correct summaries are called", {
summaries = c("min_tmin"),
override = TRUE))
expect_true(identical(names(result_annual[[2]]), c("station", "year", "min_tmin")))
})
})

0 comments on commit f61fcc3

Please sign in to comment.