Skip to content

Commit

Permalink
add unit testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanergun committed Feb 15, 2022
1 parent 0373f5c commit 51c331c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions test/opf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ s = Dict("output" => Dict("branch_flows" => true), "conv_losses_mp" => true)
end
end

@testset "test IVR OPF" begin
@testset "5-bus ac dc case" begin
result = PowerModelsACDC.run_acdcopf_iv("../test/data/case5_acdc.m", IVRPowerModel, ipopt_solver; setting = s)

@test result["termination_status"] == LOCALLY_SOLVED
@test isapprox(result["objective"], 194.16; atol = 1e0)
end

@testset "39-bus ac dc case" begin
result = PowerModelsACDC.run_acdcopf_iv("../test/data/case39_acdc.m", IVRPowerModel, ipopt_solver; setting = s)

@test result["termination_status"] == LOCALLY_SOLVED
@test isapprox(result["objective"], 41968.88; atol = 1e0)
end
end

@testset "test dc opf" begin
@testset "3-bus case" begin
result = run_acdcopf("../test/data/case3.m", DCPPowerModel, ipopt_solver; setting = s)
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/ACDCIVRtest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Memento
import JuMP


file_case5acdc = "./test/data/case3120sp_acdc.m"
file = file_case5acdc
file = "./test/data/case3120sp_acdc.m"


data = _PM.parse_file(file)

Expand Down

0 comments on commit 51c331c

Please sign in to comment.