Skip to content

Commit

Permalink
test: add override tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ovsds committed Dec 17, 2024
1 parent 7162ffd commit fcca2ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/dl_settings/dl_settings_tests/unit/base/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ class Settings(dl_settings.BaseRootSettings):
field2: str = NotImplemented

config1 = {"field1": "config1_value"}
config2 = {"field2": "config2_value"}
config2 = {
"field1": "config2_value",
"field2": "config2_value",
}

config1_path = tmp_configs.add(config1)
config2_path = tmp_configs.add(config2)
Expand Down Expand Up @@ -137,7 +140,12 @@ class NestedSettings(dl_settings.BaseSettings):
class Settings(dl_settings.BaseRootSettings):
nested: NestedSettings = pydantic.Field(default_factory=NestedSettings)

config = {"nested": {"field2": "config_value"}}
config = {
"nested": {
"field1": "config_value",
"field2": "config_value",
}
}
config_path = tmp_configs.add(config)

monkeypatch.setenv("NESTED__FIELD1", "env_value")
Expand Down

0 comments on commit fcca2ca

Please sign in to comment.