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(expected: Message | str)
Test the argument equals the given protobuf message.
approximately
approximately(matcher: Matcher[Message],
float_margin: float | None = None,
float_fraction: float | None = 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: Matcher[Message])
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(matcher: Matcher[Message])
Test the argument equals the given protobuf message, ignoring the ordering of any repeated field.
partially
partially(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 comparison.
Development
This project uses uv for dependency management and just as a command runner.
just install # create the venv and generate the test protos
just # format, run all checks (ruff, pyright, deptry), and test
See the Justfile for individual recipes.
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.8.tar.gz.
File metadata
- Download URL: hamcrest_proto-0.0.8.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
522f3424c72390bc6c8e3daab807a0afb4c73f7cbecc78b6600e20638543cab4
|
|
| MD5 |
f8d437c8e552aa51c60414499c82278d
|
|
| BLAKE2b-256 |
769023d1da38ac157fcca2515ef15be9d776bb64120dfe8a4009242fb3440aec
|
Provenance
The following attestation bundles were made for hamcrest_proto-0.0.8.tar.gz:
Publisher:
publish.yml on mdepinet/hamcrest-proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hamcrest_proto-0.0.8.tar.gz -
Subject digest:
522f3424c72390bc6c8e3daab807a0afb4c73f7cbecc78b6600e20638543cab4 - Sigstore transparency entry: 2427938477
- Sigstore integration time:
-
Permalink:
mdepinet/hamcrest-proto@88cc67e1ad6e9ff21c0b3e2288dcd3373ac78ec8 -
Branch / Tag:
refs/tags/0.0.8 - Owner: https://github.com/mdepinet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@88cc67e1ad6e9ff21c0b3e2288dcd3373ac78ec8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hamcrest_proto-0.0.8-py3-none-any.whl.
File metadata
- Download URL: hamcrest_proto-0.0.8-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ca262eef8371f90b2b3b35c3dc30913d9989bdcbd561c7fa86bda33a5d2f7e4
|
|
| MD5 |
5d5bdea3a087aac8eaa19aeaca7414d8
|
|
| BLAKE2b-256 |
96e94f60f14a87e04f0f2330baa07321a8c9102f69716a91d2eb0b9704e474a4
|
Provenance
The following attestation bundles were made for hamcrest_proto-0.0.8-py3-none-any.whl:
Publisher:
publish.yml on mdepinet/hamcrest-proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hamcrest_proto-0.0.8-py3-none-any.whl -
Subject digest:
0ca262eef8371f90b2b3b35c3dc30913d9989bdcbd561c7fa86bda33a5d2f7e4 - Sigstore transparency entry: 2427938641
- Sigstore integration time:
-
Permalink:
mdepinet/hamcrest-proto@88cc67e1ad6e9ff21c0b3e2288dcd3373ac78ec8 -
Branch / Tag:
refs/tags/0.0.8 - Owner: https://github.com/mdepinet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@88cc67e1ad6e9ff21c0b3e2288dcd3373ac78ec8 -
Trigger Event:
release
-
Statement type: