Skip to content

Commit

Permalink
add testing for cases without args
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Jul 1, 2024
1 parent 4edb891 commit a9fa3ab
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
22 changes: 20 additions & 2 deletions test/test_psisystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,39 @@
system_catalog = SystemCatalog(SYSTEM_CATALOG)
for (name, descriptor) in system_catalog.data[PSISystems]
supported_args_permutations = PSB.get_supported_args_permutations(descriptor)
if isempty(supported_args_permutations)
sys = build_system(
PSISystems,
name;
force_build = true,
)
@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name)
sys2 = build_system(
PSISystems,
name,
)
@test isa(sys2, System)

PSB.clear_serialized_system(name)
@test !PSB.is_serialized(name)
end
for supported_args in supported_args_permutations
sys = build_system(
PSISystems,
name;
force_build = true,
supported_args...,
)

@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name, supported_args)
sys2 = build_system(
PSISystems,
name;
force_build = true,
supported_args...,
)
@test isa(sys2, System)
Expand Down
22 changes: 20 additions & 2 deletions test/test_psytestsystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,39 @@
for (name, descriptor) in system_catalog.data[PSYTestSystems]
# build a new system from scratch
supported_args_permutations = PSB.get_supported_args_permutations(descriptor)
if isempty(supported_args_permutations)
sys = build_system(
PSYTestSystems,
name;
force_build = true,
)
@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name)
sys2 = build_system(
PSYTestSystems,
name,
)
@test isa(sys2, System)

PSB.clear_serialized_system(name)
@test !PSB.is_serialized(name)
end
for supported_args in supported_args_permutations
sys = build_system(
PSYTestSystems,
name;
force_build = true,
supported_args...,
)

@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name, supported_args)
sys2 = build_system(
PSYTestSystems,
name;
force_build = true,
supported_args...,
)
@test isa(sys2, System)
Expand Down

0 comments on commit a9fa3ab

Please sign in to comment.