Skip to content

Commit

Permalink
✅ Add sweep integration test with ProcessDef
Browse files Browse the repository at this point in the history
  • Loading branch information
valentingol committed Dec 15, 2023
1 parent 0d4def6 commit 6dd5b04
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/integration/test_sweep.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Integration test for sweep updates."""
import pytest_check as check

from cliconfig import make_config, update_config


def test_sweep() -> None:
"""Integration test for sweep."""
config = make_config("tests/configs/integration/sweep.yaml", no_cli=True)
expected_dict = {
"args": {"a": 5, "b": 3, "c": True, "d": [1, 0]},
"res": [1, 0, 3, 6],
}
check.equal(config.dict, expected_dict)

config = update_config(
config, {"args": {"a": 2, "b": 7, "c": False, "d": [1, 2, 3]}}
)
expected_dict = {
"args": {"a": 2, "b": 7, "c": False, "d": [1, 2, 3]},
"res": [1, 2, 3, 0, 7],
}
check.equal(config.dict, expected_dict)
config = update_config(config, {"args": {"a": 2}, "res": 5})
check.equal(config.res, 5)
config = update_config(config, {"args": {"a": 3}})
check.equal(config.res, 5)

0 comments on commit 6dd5b04

Please sign in to comment.