Hamcrest matchers for protobufs
Project description
hamcrest-proto
Hamcrest matchers for Protocol Buffers in Python.
This is forked from proto-matcher which was no longer receiving updates and which was itself based on MessageDifferencer and EqualsProto googletest matcher.
API
This packages provides the following proto-related matchers:
equals_proto
equals_proto(message: Union[Message, str])
Test the argument equals the given protobuf message.
approximately
approximately(proto_matcher: Matcher[Message],
float_margin: Optional[float] = None,
float_fraction: Optional[float] = None)
Test the argument equals the given protobuf message, while comparing any float field using approximation.
ignoring_field_paths
ignoring_field_paths(field_paths: Set[Tuple[str, ...]],
matcher: _ProtoMatcher)
Test the argument equals the given protobuf message, while ignoring those fields specified in the field paths.
ignoring_repeated_field_ordering
ignoring_repeated_field_ordering(proto_matcher: Matcher[Message])
Test the argument equals the given protobuf message, ignoring the ordering of any repeated field.
partially
partially(proto_matcher: Matcher[Message])
Test the argument partially equals the given protobuf message, i.e. if a field is in the argument but not in the expected message, it's ignored in the comparsion.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hamcrest_proto-0.0.6.tar.gz.
File metadata
- Download URL: hamcrest_proto-0.0.6.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0320c5b30faeefd3cb78fec68153b8f8e523cf0a7ea4ccaeb7ed44e94d98864
|
|
| MD5 |
18bbac22756177936caf4d34427b6031
|
|
| BLAKE2b-256 |
f3889177e372ba6a4a5306acab1b3b245555959b8a6343f578ee0c5c7c39dd13
|
File details
Details for the file hamcrest_proto-0.0.6-py3-none-any.whl.
File metadata
- Download URL: hamcrest_proto-0.0.6-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fff05ba12ced920013a113ff3e185d6065ad741369f34192b1acb6de135e9a6
|
|
| MD5 |
711c86ffc3c52eeb13b7ad53a89ab3ff
|
|
| BLAKE2b-256 |
2fb5269d3ee9e940b0a849e28ee9a6ef41caf84db4247e0cc3ac711b3cf2655a
|