Skip to content

Commit

Permalink
season_start_probabilities test
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyclements committed Oct 25, 2023
1 parent ca25d96 commit 71a0dec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
Binary file added tests/test_1_season_start_probabilities.rds
Binary file not shown.
32 changes: 12 additions & 20 deletions tests/testthat/test-season_start_probabilities.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
# library(testthat)
#
# # External functions call
# # Test case 1: Test with all parameters
# result <-
# season_start_probabilities(
# country = "zm",
# station_id = "16",
# start_dates = c(10, 20, 100)
# )
#
# # Test case 2: Test with missing parameters
# result_2 <-
# season_start_probabilities(country = "zm", station_id = "16")
#
# # Define test cases
# test_that("season_start_probabilities returns correct results", {
# expect_no_error(result)
# expect_no_error(result_2)
# })
library(testthat)
library(rpicsa)

# Test case 1
epicsawrap::gcs_auth_file(file = "tests/e-picsa-e630400792e7.json")
test_1_results <- readRDS("tests/test_1_season_start_probabilities.rds")
country <- "zm"
station_id <- "test_1"
result <- epicsawrap::season_start_probabilities(country, station_id, c(0, 150, 300))
test_that("Correct summaries are calculated", {
expect_true(identical(result[[2]], test_1_results))
})

0 comments on commit 71a0dec

Please sign in to comment.