Skip to main content

common.tests.matchers

FuzzyDict

class FuzzyDict(calleee.base.BaseMatcher)

Matches dicts based on their items.

To match successfully, the dict needs to:

  • have the keys/values that correspond exactly to positional dict

Examples:

FuzzyDict('foo')  # `foo` attribute with any value
FuzzyDict('foo', 'bar') # `foo` and `bar` attributes with any values
FuzzyDict(foo=42) # `foo` attribute with value of 42
FuzzyDict(bar=Integer()) # `bar` attribute whose value is an integer
FuzzyDict('foo', bar='x') # `foo` with any value, `bar` with value of 'x'

__repr__

def __repr__()

Return a representation of the matcher.