Skip to content

dynamic attribute assertions for dicts #49

@saturnboy

Description

@saturnboy

Much like #44, we should extend the has_foo() dynamic assertion to work on dicts (or dict-like objects).

Currently, dynamic assertions work like this (on objects):

fred = Person('Fred', 'Smith')
assert_that(fred).has_first_name('Fred')

Make it work for dicts / dict-like objects (aka anything with __getitem__()) too:

fred = {'first_name': 'Fred', 'last_name': 'Smith'}
assert_that(fred).has_first_name('Fred')

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions