Partial protobuf matcher.
Compares a protobuf message against an expected dict by converting the message via :py:func:testsuite.protobuf.utils.message_to_dict and delegating to :py:class:testsuite.matching.PartialDict. Only the keys listed in the expected dict are checked; any additional fields on the protobuf message are ignored.
The match is only partial at the top level: nested dicts in the expected pattern still have to equal the corresponding nested message dicts exactly. Use :py:class:RecursivePartialProtobufDict when nested messages should also be matched partially.
Example:
.. code-block:: python
assert msg == matching.PartialProtobufDict({'first_name': 'John'})
Definition at line 54 of file matching.py.
Public Member Functions | |
| __init__ (self, d) | |
| __repr__ (self) | |
| __eq__ (self, other) | |
Protected Attributes | |
| _repr = repr | |
| _impl = impl | |
| testsuite.protobuf.matching.PartialProtobufDict.__init__ | ( | self, | |
| d ) |
Definition at line 76 of file matching.py.
|
inherited |
Definition at line 17 of file matching.py.
|
inherited |
Definition at line 14 of file matching.py.
|
protectedinherited |
Definition at line 12 of file matching.py.
|
protectedinherited |
Definition at line 11 of file matching.py.