expyct.combination module

class expyct.combination.OneOf(options: Collection)

Bases: expyct.base.BaseMatcher

Object must equal one of the given options.

This can be recursively used to check nested objects. For example:

expyct.OneOf([
    expyct.ANY_DATE,
    expyct.dict(keys=["from", "until"], values=expyct.ANY_DATE)
])
Parameters

options – objects to compare to