Strict protobuf matcher.
Compares a protobuf message against an expected dict by converting the message via :py:func:testsuite.protobuf.utils.message_to_dict and requiring the resulting dict to equal the expected one exactly.
Every field present in the message must appear in the expected dict (and vice versa). For partial matching where extra protobuf fields should be ignored, use :py:class:PartialProtobufDict or :py:func:RecursivePartialProtobufDict instead.
Example:
.. code-block:: python
assert msg == matching.ProtobufDict({ 'first_name': 'John', 'last_name': 'Doe', 'status': 'STATUS_ACTIVE', })
Definition at line 25 of file matching.py.
Public Member Functions | |
| __init__ (self, dict d) | |
| __repr__ (self) | |
| __eq__ (self, other) | |
Protected Attributes | |
| _repr = repr | |
| _impl = impl | |
| testsuite.protobuf.matching.ProtobufDict.__init__ | ( | self, | |
| dict | d ) |
Definition at line 50 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.