-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, only assert functions and .keys()
are available. This makes it impossible to access a specific key for custom assertions, which is necessary if a dict has non-trivial values (e.g. a dict of key->provider or structs).
API: get(key, *, factory)
, e.g.
def foo_test(env):
foo_info = env.expect.that_dict(...).get("foo", factory=FooInfoSubject.new)
That the get()
behavior isn't exactly the same as a regular dict.get is unfortunate, but I can't think of a great name to replace the []
operator.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request