From 3e536138bd643e4545df9a30f23c7b1ab84e0ac4 Mon Sep 17 00:00:00 2001 From: lrennels Date: Wed, 23 Sep 2020 23:34:56 -0700 Subject: [PATCH] Fix warnings --- test/test_explorer_compositecomp.jl | 3 +-- test/test_explorer_model.jl | 3 +-- test/test_explorer_sim.jl | 9 +++++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/test_explorer_compositecomp.jl b/test/test_explorer_compositecomp.jl index d26d19560..39002dc7e 100644 --- a/test/test_explorer_compositecomp.jl +++ b/test/test_explorer_compositecomp.jl @@ -53,7 +53,6 @@ close(w) # dim_name::Union{Nothing, Symbol} = nothing) items = [:fooA1, :fooA2, :foo3, :foo4, :var_3_1, :par_1_1] for item in items - p = Mimi.plot(m, :top, item) p_type = _is_VegaLite_v3() ? VegaLite.VLSpec : VegaLite.VLSpec{:plot} - @test typeof(p) == p_type + @test typeof(Mimi.plot(m, :top, item)) == p_type end diff --git a/test/test_explorer_model.jl b/test/test_explorer_model.jl index a309632f4..94d139dd6 100644 --- a/test/test_explorer_model.jl +++ b/test/test_explorer_model.jl @@ -74,9 +74,8 @@ close(w) # dim_name::Union{Nothing, Symbol} = nothing) items = [:a, :b, :c, :d, :e, :f, :x] for item in items - p = Mimi.plot(m, :MyComp, item) p_type = _is_VegaLite_v3() ? VegaLite.VLSpec : VegaLite.VLSpec{:plot} - @test typeof(p) == p_type + @test typeof(Mimi.plot(m, :MyComp, item)) == p_type end #6. errors and warnings diff --git a/test/test_explorer_sim.jl b/test/test_explorer_sim.jl index b779137d9..3ff5102bd 100644 --- a/test/test_explorer_sim.jl +++ b/test/test_explorer_sim.jl @@ -10,6 +10,11 @@ using CSVFiles import Mimi: _spec_for_sim_item, menu_item_list, getdataframe, get_sim_results +# Helper function returns true if VegaLite is verison 3 or above, and false otherwise +function _is_VegaLite_v3() + return isdefined(VegaLite, :vlplot) ? true : false +end + # Get the example include("mcs/test-model-2/multi-region-model.jl") using .MyModel @@ -71,7 +76,7 @@ w = explore(si_disk, title="Testing Window", results_output_dir = results_output @test typeof(w) == Electron.Window close(w) -@test_throws ErrorException w = explore(si_disk) #should error, no in-memory results +@test_throws ErrorException explore(si_disk) #should error, no in-memory results ## 3. Plots @@ -94,7 +99,7 @@ plot_type_test(p) p = Mimi.plot(si_disk, :emissions, :E_Global; interactive = true, results_output_dir = results_output_dir) plot_type_test(p) -@test_throws ErrorException p = Mimi.plot(si_disk, :emissions, :E_Global) #should error, no in-memory results +@test_throws ErrorException Mimi.plot(si_disk, :emissions, :E_Global) #should error, no in-memory results # mulitrumpet plot p = Mimi.plot(si, :emissions, :E)