Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rtesra committed Dec 11, 2024
1 parent 5c7ec60 commit 6adbfbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-01-run-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ test_that("exceeding max_iterations raises convergence warning", {
expect_length(out$warnings, 3)

expect_equal(out$warnings[[1]]$text,
paste0("Naomi subnational data not equal to Spectrum national data. Check table on review inputs tab for: \nnumber_on_art: 2011;2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023"))
paste0("Naomi subnational data not equal to Spectrum national data. Check table on review inputs tab for: \nnumber_on_art: 2019;2021;2022;2023"))

expect_equal(out$warnings[[3]]$text,
paste0("Convergence error: iteration limit reached without convergence (10)"))
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-downloads.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ test_that("spectrum download can be created", {
expect_equal(names(navigator_checklist),
c("NaomiCheckPermPrimKey", "NaomiCheckDes", "TrueFalse"))

checklist_primkeys <- c( "ART_is_Spectrum","ANC_is_Spectrum","Package_created",
"Package_has_all_data","Opt_recent_qtr","Opt_future_proj_qtr",
checklist_primkeys <- c( "Package_created", "Package_has_all_data","Opt_recent_qtr","Opt_future_proj_qtr",
"Opt_area_ID_selected","Opt_calendar_survey_match","Opt_recent_survey_only",
"Opt_ART_coverage","Opt_ANC_data","Opt_ART_data",
"Opt_ART_attendance_yes","Model_fit","Cal_Population",
Expand Down Expand Up @@ -257,8 +256,7 @@ test_that("spectrum download can be created", {
expect_equal(names(navigator_checklist),
c("NaomiCheckPermPrimKey", "NaomiCheckDes", "TrueFalse"))

checklist_primkeys <- c( "ART_is_Spectrum","ANC_is_Spectrum","Package_created",
"Package_has_all_data","Opt_recent_qtr","Opt_future_proj_qtr",
checklist_primkeys <- c( "Package_has_all_data","Opt_recent_qtr","Opt_future_proj_qtr",
"Opt_area_ID_selected","Opt_calendar_survey_match","Opt_recent_survey_only",
"Opt_ART_coverage","Opt_ANC_data","Opt_ART_data",
"Opt_ART_attendance_yes","Model_fit","Cal_Population",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-warning.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test_that("warning raised after false convergence", {

expect_length(out$warnings, 3)
expect_match(out$warnings[[1]]$text,
"Naomi subnational data not equal to Spectrum national data. Check table on review inputs tab for: \nnumber_on_art: 2011;2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023")
"Naomi subnational data not equal to Spectrum national data. Check table on review inputs tab for: \nnumber_on_art: 2019;2021;2022;2023")
expect_match(out$warnings[[2]]$text,
"Naomi subnational data not equal to Spectrum national data. Check table on review inputs tab for: \nanc_already_art: 2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023\nanc_clients: 2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023\nanc_known_neg: 2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023\nanc_known_pos: 2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023\nanc_tested: 2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2023")
expect_equal(out$warnings[[3]]$text,
Expand Down

0 comments on commit 6adbfbc

Please sign in to comment.