MCPcopy Create free account
hub / github.com/pydantic/pydantic-settings / test_cli_nested_dataclass_arg

Function test_cli_nested_dataclass_arg

tests/test_source_cli.py:738–750  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

736
737
738def test_cli_nested_dataclass_arg():
739 @pydantic_dataclasses.dataclass
740 class MyDataclass:
741 foo: int
742 bar: str
743
744 class Settings(BaseSettings):
745 n: MyDataclass
746
747 s = CliApp.run(Settings, cli_args=['--n.foo', '123', '--n.bar', 'bar value'])
748 assert isinstance(s.n, MyDataclass)
749 assert s.n.foo == 123
750 assert s.n.bar == 'bar value'
751
752
753def no_add_cli_arg_spaces(arg_str: str, has_quote_comma: bool = False) -> str:

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…