diff --git a/src/dash_cli.jl b/src/dash_cli.jl index ff53ee5..fc29afb 100644 --- a/src/dash_cli.jl +++ b/src/dash_cli.jl @@ -37,6 +37,7 @@ function dash(args; kws...) else # Wrong arguments @error "Unrecognized argument" + result = nothing end #to do more? diff --git a/src/data_cli.jl b/src/data_cli.jl index 144afc8..4c8a808 100644 --- a/src/data_cli.jl +++ b/src/data_cli.jl @@ -39,6 +39,7 @@ function data(args; kws...) else # Wrong arguments @error "Unrecognized argument" + rslt = nothing end return rslt diff --git a/src/model_cli.jl b/src/model_cli.jl index a9a06a6..a1b5df6 100644 --- a/src/model_cli.jl +++ b/src/model_cli.jl @@ -38,6 +38,7 @@ function model(args; kws...) else # Wrong arguments @error "Unrecognized argument" + rslt = nothing end #to do more? diff --git a/test/controller_cli_test.jl b/test/controller_cli_test.jl index d0744e8..09f8e23 100644 --- a/test/controller_cli_test.jl +++ b/test/controller_cli_test.jl @@ -574,4 +574,51 @@ end end +@testset "Controller error message test" begin + + rslt = controller(:ki) + @test rslt == nothing + + rslt = controller(:ls, project_ = "1") + @test rslt == nothing + + rslt = controller(:rm, project = "1") + @test rslt == nothing + + rslt = controller(:rm, project_name = "1") + @test rslt == nothing + + rslt = controller(:tune, project = "1") + @test rslt == nothing + + rslt = controller(:tune, project_name = "1") + @test rslt == nothing + + rslt = controller(:tune, project_name = "1", system_name = "1") + @test rslt == nothing + + rslt = controller(:tune, project_name = "1", system_name = "1", mpc_horizon = 1) + @test rslt == nothing + + rslt = controller(:tune, project_name = "1", system_name = "1", mpc_horizon = 1, mpc_sample_time = 5) + @test rslt == nothing + + rslt = controller(:tune, project_name = "1", system_name = "1", mpc_horizon = 1, mpc_sample_time = 5, mpc_state_reference = 1) + @test rslt == nothing + + rslt = controller(:calculate) + @test rslt == nothing + + rslt = controller(:calculate, initialization = 1) + @test rslt == nothing + + #rslt = controller(:calculate, initialization = 1, controller_name = "1") + #@test rslt == nothing + + rslt = controller(:retrieve) + @test rslt == nothing + +end + + end diff --git a/test/dash_cli_test.jl b/test/dash_cli_test.jl index dc5a361..04f5612 100644 --- a/test/dash_cli_test.jl +++ b/test/dash_cli_test.jl @@ -210,4 +210,50 @@ end end +@testset "Dash error message test" begin + + rslt = dash(:ki) + @test rslt == nothing + + rslt = dash(:rawdata, project_ = "1") + @test rslt == nothing + + rslt = dash(:rawdata, project_name = "1") + @test rslt == nothing + + rslt = dash(:rawdata, project_name = "1", data_name = "1") + @test rslt == nothing + + rslt = dash(:rawdata, project_name = "1", data_name = "1", recipe = "1") + @test rslt == nothing + + rslt = dash(:iodata, project_ = "1") + @test rslt == nothing + + rslt = dash(:iodata, project_name = "1") + @test rslt == nothing + + rslt = dash(:iodata, project_name = "1", data_name = "1") + @test rslt == nothing + + rslt = dash(:iodata, project_name = "1", data_name = "1", recipe = "1") + @test rslt == nothing + + rslt = dash(:model, project_ = "1") + @test rslt == nothing + + rslt = dash(:model, project_name = "1") + @test rslt == nothing + + rslt = dash(:ls, project = "1") + @test rslt == nothing + + rslt = dash(:rm, project = "1") + @test rslt == nothing + + rslt = dash(:rm, project_name = "1") + @test rslt == nothing + +end + end diff --git a/test/data_cli_test.jl b/test/data_cli_test.jl index 36430b1..b0c6a4e 100644 --- a/test/data_cli_test.jl +++ b/test/data_cli_test.jl @@ -76,4 +76,54 @@ using AutomationLabs end +@testset "Data error message test" begin + + rslt = data(:ki) + @test rslt == nothing + + rslt = data(:add, project_ = "1") + @test rslt == nothing + + rslt = data(:add, project = "1") + @test rslt == nothing + + rslt = data(:add, project_name = "1") + @test rslt == nothing + + rslt = data(:add, project_name = "1", path = "1") + @test rslt == nothing + + rslt = data(:lsio, project = "1") + @test rslt == nothing + + rslt = data(:lsraw, project = "1") + @test rslt == nothing + + rslt = data(:rmio, project = "1") + @test rslt == nothing + + rslt = data(:rmraw, project = "1") + @test rslt == nothing + + rslt = data(:rmio, project_name = "1") + @test rslt == nothing + + rslt = data(:rmraw, project_name = "1") + @test rslt == nothing + + rslt = data(:io, project = "1") + @test rslt == nothing + + rslt = data(:io, project_name = "1") + @test rslt == nothing + + rslt = data(:io, project_name = "1", inputs_data_name = "1") + @test rslt == nothing + + #rslt = data(:io, project_name = "1", inputs_data_name = "1", outputs_data_name = "1") + #@test rslt == nothing + # Add a protect + +end + end diff --git a/test/exportation_cli_test.jl b/test/exportation_cli_test.jl index 0fd0f8b..43f5bd2 100644 --- a/test/exportation_cli_test.jl +++ b/test/exportation_cli_test.jl @@ -207,4 +207,32 @@ using Dates end +@testset "Exportation error message test" begin + + rslt = exportation(:ki) + @test rslt == nothing + + rslt = exportation(:ls, project_ = "1") + @test rslt == nothing + + rslt = exportation(:rm, project = "1") + @test rslt == nothing + + rslt = exportation(:rm, project_name = "1") + @test rslt == nothing + + rslt = exportation(:tune, project = "1") + @test rslt == nothing + + rslt = exportation(:tune, project_name = "1") + @test rslt == nothing + + rslt = exportation(:tune, project_name = "1", model_name = "1") + @test rslt == true #should be false or nothing + + #rslt = exportation(:tune, project_name = "1", controller_name = "1") + #@test rslt == true + +end + end \ No newline at end of file diff --git a/test/model_cli_test.jl b/test/model_cli_test.jl index a8163d9..13a58b8 100644 --- a/test/model_cli_test.jl +++ b/test/model_cli_test.jl @@ -187,5 +187,54 @@ end end +@testset "Model error message test" begin + + rslt = model(:ki) + @test rslt == nothing + + rslt = model(:tune, projectç = "1") + @test rslt == nothing + + rslt = model(:tune, project_name = "1") + @test rslt == nothing + + #rslt = model(:tune, project_name = "1", io = "1") return issue + #@test rslt == nothing + + rslt = model(:ls, projectc = "1") + @test rslt == nothing + + rslt = model(:rm, project = "1") + @test rslt == nothing + + rslt = model(:rm, project_name = "1") + @test rslt == nothing + + rslt = model(:stats, project = "1") + @test rslt == nothing + + rslt = model(:stats, project_name = "1") + @test rslt == nothing + + rslt = model(:create, project = "1") + @test rslt == nothing + + rslt = model(:create, project_name = "1") + @test rslt == nothing + + rslt = model(:create, project_name = "1", model_anme = "1") + @test rslt == nothing + + rslt = model(:create, project_name = "1", model_anme = "1", nbr_state = 2) + @test rslt == nothing + + rslt = model(:create, project_name = "1", model_anme = "1", nbr_state = 2, nbr_input = 2) + @test rslt == nothing + + rslt = model(:create, project_name = "1", model_anme = "1", nbr_state = 2, nbr_input = 2, variation = "1") + @test rslt == nothing + +end + end diff --git a/test/project_cli_test.jl b/test/project_cli_test.jl index 76e1027..87edaa3 100644 --- a/test/project_cli_test.jl +++ b/test/project_cli_test.jl @@ -52,6 +52,9 @@ end rslt = project(:rm, name = "gt") @test rslt == false + rslt = project(:rm, namez = "gt") + @test rslt == nothing + rslt = project(:rm, name = pjt[1]) @test rslt == true diff --git a/test/system_cli_test.jl b/test/system_cli_test.jl index e88c3bd..db2d8c3 100644 --- a/test/system_cli_test.jl +++ b/test/system_cli_test.jl @@ -329,6 +329,8 @@ end system(:ls, project_name = "qtp_test", show_all = true) rslt = system(:ls, project_name = "gt") @test size(rslt) == (0, 6) + rslt = system(:ls, project_namezz = "gt") + @test rslt == nothing # Wrong rm rslt = system(:rm, project_name = "qtp_test")