forked from lanl-ansi/PowerModels.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.jl
75 lines (60 loc) · 1.97 KB
/
io.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@testset "export data to other file types" begin
function test_export(filename::AbstractString, extension::AbstractString)
source_data = parse_file(filename)
file_tmp = "../test/data/tmp." * extension
PowerModels.export_file(file_tmp, source_data)
destination_data = PowerModels.parse_file(file_tmp)
rm(file_tmp)
@test true
end
@testset "test case30.m" begin
file = "../test/data/matpower/case30.m"
test_export(file, "raw")
test_export(file, "json")
end
@testset "test case5.m" begin
file = "../test/data/matpower/case5.m"
test_export(file, "raw")
test_export(file, "json")
end
@testset "test case14.m" begin
file = "../test/data/matpower/case14.m"
test_export(file, "raw")
test_export(file, "json")
end
@testset "test case24.m" begin
file = "../test/data/matpower/case24.m"
test_export(file, "raw")
test_export(file, "json")
end
@testset "test case30.m" begin
file = "../test/data/matpower/case30.m"
test_export(file, "raw")
test_export(file, "json")
end
@testset "test case5_dc.m" begin
file = "../test/data/matpower/case5_dc.m"
test_export(file, "raw")
test_export(file, "json")
end
@testset "test case30.raw" begin
file = "../test/data/pti/case30.raw"
test_export(file, "m")
test_export(file, "json")
end
@testset "test case73.raw" begin
file = "../test/data/pti/case73.raw"
test_export(file, "m")
test_export(file, "json")
end
@testset "test frankenstein_00_2.raw" begin
file = "../test/data/pti/frankenstein_00_2.raw"
test_export(file, "m")
test_export(file, "json")
end
@testset "test frankenstein_20.raw" begin
file = "../test/data/pti/frankenstein_20.raw"
test_export(file, "m")
test_export(file, "json")
end
end