Partial dictionary matching.
It might be useful to only check specific keys of a dictionary. :py:class:PartialDict serves to solve this task.
:py:class:PartialDict is wrapper around regular dict() when instantiated all arguments are passed as is to internal dict object.
Example:
.. code-block:: python
assert {'foo': 1, 'bar': 2} == matching.PartialDict({
'foo': matching.Ge(1), })
Definition at line 298 of file matching.py.
Public Member Functions | |
| __init__ (self, *args, **kwargs) | |
| __contains__ (self, item) | |
| __getitem__ (self, item) | |
| __iter__ (self) | |
| __len__ (self) | |
| __repr__ (self) | |
| __eq__ (self, other) | |
| __testsuite_visit__ (self, visit) | |
| __testsuite_resolve_value__ (self, other, report_error) | |
Protected Attributes | |
| _dict = dict(*args, **kwargs) | |
| testsuite.matching.PartialDict.__init__ | ( | self, | |
| * | args, | ||
| ** | kwargs ) |
Definition at line 319 of file matching.py.
| testsuite.matching.PartialDict.__contains__ | ( | self, | |
| item ) |
Definition at line 322 of file matching.py.
| testsuite.matching.PartialDict.__eq__ | ( | self, | |
| other ) |
Definition at line 337 of file matching.py.
| testsuite.matching.PartialDict.__getitem__ | ( | self, | |
| item ) |
Definition at line 325 of file matching.py.
| testsuite.matching.PartialDict.__iter__ | ( | self | ) |
Definition at line 328 of file matching.py.
| testsuite.matching.PartialDict.__len__ | ( | self | ) |
Definition at line 331 of file matching.py.
| testsuite.matching.PartialDict.__repr__ | ( | self | ) |
Definition at line 334 of file matching.py.
| testsuite.matching.PartialDict.__testsuite_resolve_value__ | ( | self, | |
| other, | |||
| report_error ) |
Definition at line 350 of file matching.py.
| testsuite.matching.PartialDict.__testsuite_visit__ | ( | self, | |
| visit ) |
Definition at line 347 of file matching.py.
|
protected |
Definition at line 320 of file matching.py.