Skip to content

Commit

Permalink
test: validation error raised if 'output_root' provided
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney committed Aug 13, 2024
1 parent dd3ab64 commit 826fd5f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/ngen_cal/tests/test_ngen.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,19 @@ def test_NgenIndependent_strategy_default_value():
o = NgenIndependent.construct()
assert o.strategy == NgenStrategy.independent


def test_NgenUniform_strategy_default_value():
# construct object without validation.
o = NgenUniform.construct()
assert o.strategy == NgenStrategy.uniform


def test_NgenBase_verify_realization(ngen_config: Ngen):
config = ngen_config.__root__.copy()
assert isinstance(config, NgenBase)

assert config.ngen_realization is not None
config.ngen_realization.output_root = pathlib.Path("./output_root")

with pytest.raises(pydantic.ValidationError):
Ngen.parse_obj(dict(config))

0 comments on commit 826fd5f

Please sign in to comment.