Test File 8 test-main-r-part3-generate-output-graphs.R

Summary

  • Number of test(s) : 2

  • Number of expectation(s) : 13

  • Number of successful expectation(s) : 6

  • Number of failed expectation(s) : 0

  • Number of errored expectation(s) : 0

  • Number of expectations with warning(s) : 7

  • Number of validated skip expectation(s) : 0

  • Number of skipped expectation(s) : 0

Details

Test Description Expectation Result Location Test_time
(code run outside of test_that()) test_that(“Main functions work together”, { # Set up params for the model # use samp_process = 1 in model fit # use month_start = 10 and month_end = 12 # these parameters allow eta plot generation # run part1 survey_data_file <- system.file(“original_data”, “Solea_solea”, “survey_data.Rds”, package = “FishMap” ) survey_data <- readr::read_rds(file = survey_data_file) vmslogbook_data_file <- system.file(“original_data”, “Solea_solea”, “vmslogbook_data.Rds”, package = “FishMap” ) vmslogbook_data <- readr::read_rds(file = vmslogbook_data_file) study_domain_file <- system.file(“original_data”, “Solea_solea”, “study_domain.Rds”, package = “FishMap” ) study_domain <- readr::read_rds(file = study_domain_file) fm_data_inputs <- fm_load_data(species = “Solea_solea”, fleet = c(“OTB_DEF_>=70_0”,“OTB_CEP_>=70_0”,“OTT_DEF_>=70_0”), fitted_data = “biomass”, survey_data = survey_data, vmslogbook_data = vmslogbook_data, study_domain = study_domain, year_start = 2018, year_end = 2018, month_start = 10, month_end = 12, time_step = “Month”, k = 0.25, grid_xmin = -6, grid_xmax = 0, grid_ymin = 42, grid_ymax = 48) #‘@description Testing that fm_data_inputs return a named list for the next function test_list <- is.list(fm_data_inputs) test_name <- length(names(fm_data_inputs)) != 0 expect_true(test_list & test_name) #’@descripton Testing if fm_fit_model always work result_fit_model <- try( fm_fit_model(fm_data_inputs = fm_data_inputs, SE = 1, data_source = 1, data_obs = 2, samp_process = 1, b_constraint = 2, cov_samp_process = 0, biomass_temporal = 1, sampling_temporal = 0, lf_link = 0, ref_data = “com”, EM = “est_b”, month_ref = 1), silent = TRUE) expect_true( !inherits(result_fit_model, “try-error”), label = “fm_fit_model generate a error. Please check the core function or the returned objet of fm_load_data. Running function” ) #‘@descripton Testing if fm_fit_model always work result_graph <- try(fm_generate_graphs(result_fit_model), silent = TRUE) expect_true( !inherits(result_graph, “try-error”), label = “fm_generate_graphs generate a error. Please check the core function or the returned objet of fm_fit_model. Running function” ) #’@description testing output of fm_generate_graphs expect_type(result_graph, “list”) expect_s3_class(result_graph[[“pred_plot”]], “ggplot”) expect_s3_class(result_graph[[“eta_plot”]], “ggplot”)}) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#3 2023-04-13 12:25:05
Main functions work together expect_true(test_list & test_name) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#57 2023-04-13 12:25:05
Main functions work together expect_true(test_list & test_name) Success test-main-r-part3-generate-output-graphs.R#57 2023-04-13 12:25:05
Main functions work together expect_true( !inherits(result_fit_model, “try-error”), label = “fm_fit_model generate a error. Please check the core function or the returned objet of fm_load_data. Running function” ) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#76 2023-04-13 12:29:23
Main functions work together expect_true( !inherits(result_fit_model, “try-error”), label = “fm_fit_model generate a error. Please check the core function or the returned objet of fm_load_data. Running function” ) Success test-main-r-part3-generate-output-graphs.R#76 2023-04-13 12:29:23
Main functions work together expect_true( !inherits(result_graph, “try-error”), label = “fm_generate_graphs generate a error. Please check the core function or the returned objet of fm_fit_model. Running function” ) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#85 2023-04-13 12:29:27
Main functions work together expect_true( !inherits(result_graph, “try-error”), label = “fm_generate_graphs generate a error. Please check the core function or the returned objet of fm_fit_model. Running function” ) Success test-main-r-part3-generate-output-graphs.R#85 2023-04-13 12:29:27
Main functions work together testing output of fm_generate_graphs expect_type(result_graph, “list”) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#91 2023-04-13 12:29:27
Main functions work together testing output of fm_generate_graphs expect_type(result_graph, “list”) Success test-main-r-part3-generate-output-graphs.R#91 2023-04-13 12:29:27
Main functions work together testing output of fm_generate_graphs expect_s3_class(result_graph[[“pred_plot”]], “ggplot”) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#92 2023-04-13 12:29:27
Main functions work together testing output of fm_generate_graphs expect_s3_class(result_graph[[“pred_plot”]], “ggplot”) Success test-main-r-part3-generate-output-graphs.R#92 2023-04-13 12:29:27
Main functions work together expect_s3_class(result_graph[[“eta_plot”]], “ggplot”) ⚠️ Warning test-main-r-part3-generate-output-graphs.R#93 2023-04-13 12:29:27
Main functions work together expect_s3_class(result_graph[[“eta_plot”]], “ggplot”) Success test-main-r-part3-generate-output-graphs.R#93 2023-04-13 12:29:27