Skip to content

Commit

Permalink
test that entries in default config have "help" and "value"
Browse files Browse the repository at this point in the history
  • Loading branch information
haakon-e committed Nov 26, 2024
1 parent fd0dbb6 commit 687ec64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ repeated_job_ids = filter(kv -> length(kv[2]) > 1, value_to_keys)
file, io = mktemp()
config_err = ErrorException("File $(CA.normrelpath(file)) is empty or missing.")
@test_throws config_err CA.AtmosConfig(file)

@testset "Check that entries in `default_config.yml` have `help` and `value` keys" begin
config = CA.load_yaml_file(CA.default_config_file)
missing_help = String[]
missing_value = String[]
for (key, value) in config
!haskey(value, "help") && push!(missing_help, key)
!haskey(value, "value") && push!(missing_value, key)
end
# Every key in the default config should have a `help` and `value` key
# If not, these tests will fail, indicating which keys are missing
@test isempty(missing_help)
@test isempty(missing_value)
end

0 comments on commit 687ec64

Please sign in to comment.