widgets: Make type checks more explicit.

Note that I don't actually convert the
checker from check_dict to check_dict_only,
because that would be a user-facing change,
but I think we can sweep a lot of things
like this after the next release.
This commit is contained in:
Steve Howell
2020-06-24 23:28:06 +00:00
committed by Tim Abbott
parent f960df04e8
commit 6b910ff3b4
2 changed files with 9 additions and 6 deletions

View File

@@ -351,7 +351,10 @@ def check_widget_content(widget_content: object) -> Dict[str, Any]:
]),
)
# We re-check "type" here just to avoid it looking
# like we have extraneous keys.
checker = check_dict([
('type', equals('choices')),
('heading', check_string),
('choices', check_choices),
])