-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2252,6 +2252,31 @@ class _(JSONWizard.Meta): | |
assert new_data.extra_data is False | ||
|
||
|
||
def test_catch_all_with_auto_key_case(): | ||
"""'Catch All' with `auto` key case.""" | ||
|
||
@dataclass | ||
class Options(JSONWizard): | ||
class _(JSONWizard.Meta): | ||
v1 = True | ||
debug_enabled = True | ||
v1_key_case = 'Auto' | ||
|
||
my_extras: CatchAll | ||
email: str | ||
|
||
opt = Options.from_dict({ | ||
'Email': '[email protected]', | ||
'token': '<PASSWORD>', | ||
}) | ||
assert opt == Options(my_extras={'token': '<PASSWORD>'}, email='[email protected]') | ||
|
||
opt = Options.from_dict({ | ||
'Email': '[email protected]', | ||
}) | ||
assert opt == Options(my_extras={}, email='[email protected]') | ||
|
||
|
||
@pytest.mark.xfail(reason='TODO add support in v1') | ||
def test_from_dict_with_nested_object_key_path(): | ||
""" | ||
|