diff --git a/test/nature_tests.jl b/test/nature_tests.jl index 1cb7747bc4e9a2e208bc6bc591dae0f5f6161944..d38df481ab08df74e933f9b6c12b5fb9ff4fee8e 100644 --- a/test/nature_tests.jl +++ b/test/nature_tests.jl @@ -249,28 +249,24 @@ end end end # test migration - # TODO: fix test below - # @test_logs((:info, "Initialised 2 Skylarks."), - # (:debug, "Skylark 1 has migrated."), - # (:debug, "Skylark 2 has migrated."), - # min_level=Logging.Debug, match_mode=:any, - # Ps.initpopulation!("Skylark", Ps.withtestlogger(model))) - # TODO: fix broken test - @test_broken length(model.animals) == 2 + @test_logs((:info, "Initialised 2 Skylarks."), + (:debug, "Skylark 1 has migrated."), + (:debug, "Skylark 2 has migrated."), + min_level=Logging.Debug, match_mode=:any, + Ps.initpopulation!("Skylark", Ps.withtestlogger(model))) + @test length(model.animals) == 2 @test all(isnothing, model.animals) - # TODO: fix broken tests - @test_broken length(model.migrants) == 2 - @test_broken model.migrants[1].first.sex != model.migrants[2].first.sex + @test length(model.migrants) == 2 + @test model.migrants[1].first.sex != model.migrants[2].first.sex for a in model.migrants leave, arrive = a.first.migrationdates @test leave[1] in (9, 10) || (leave[1] == 11 && leave[2] <= 15) @test (arrive[1] == 2 && arrive[2] >= 15) || (arrive[1] == 3 && arrive[2] <= 15) end model.date = Date(year(model.date), 3, 17) - # TODO: fix test below - # @test_logs((:debug, "Skylark 1 has returned."), - # (:debug, "Skylark 2 has returned."), - # min_level=Logging.Debug, match_mode=:any, - # Ps.updatenature!(Ps.withtestlogger(model))) + @test_logs((:debug, "Skylark 1 has returned."), + (:debug, "Skylark 2 has returned."), + min_level=Logging.Debug, match_mode=:any, + Ps.updatenature!(Ps.withtestlogger(model))) #TODO end diff --git a/test/test_parameters_almass.toml b/test/test_parameters_almass.toml index 94d6a9a8b25be61910d3a7d690079d2405256295..1308029ee9b7b387064752b0c0e3a70174798c77 100644 --- a/test/test_parameters_almass.toml +++ b/test/test_parameters_almass.toml @@ -4,7 +4,7 @@ ### #XXX remember that changes here may break tests! - + [core] configfile = "test_parameters.toml" # location of the configuration file outdir = "results_testsuite" # location and name of the output folder @@ -36,7 +36,7 @@ targetspecies = ["Wolpertinger", "Wyvern"] # list of target species to simulate popoutfreq = "daily" # output frequency population-level data, daily/monthly/yearly/end/never indoutfreq = "daily" # output frequency individual-level data, daily/monthly/yearly/end/never insectmodel = ["season", "habitat", "pesticides"] # which factors affect insect growth ("weather" is not yet implemented) - + [crop] cropmodel = "almass" # crop growth model to use, "almass", "aquacrop", or "simple" cropfile = "crop_data_general.csv" # file with general crop parameters diff --git a/test/test_parameters_simplecrop.toml b/test/test_parameters_simplecrop.toml index c3bfe017143eb2d7288552d778d7b357803e2b05..fc199a8c8664b0d900e131d9b5b159dc006ee502 100644 --- a/test/test_parameters_simplecrop.toml +++ b/test/test_parameters_simplecrop.toml @@ -4,7 +4,7 @@ ### #XXX remember that changes here may break tests! - + [core] configfile = "test_parameters.toml" # location of the configuration file outdir = "results_testsuite" # location and name of the output folder @@ -36,7 +36,7 @@ targetspecies = ["Wolpertinger", "Wyvern"] # list of target species to simulate popoutfreq = "daily" # output frequency population-level data, daily/monthly/yearly/end/never indoutfreq = "daily" # output frequency individual-level data, daily/monthly/yearly/end/never insectmodel = ["season", "habitat", "pesticides"] # which factors affect insect growth ("weather" is not yet implemented) - + [crop] cropmodel = "simple" # crop growth model to use, "almass", "aquacrop", or "simple" cropfile = "crop_data_general.csv" # file with general crop parameters