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
Hashes for hamcrest_proto-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaad9520d02b27372f85409706e55ab7adb0a37f32d30c96f5e41ce4e25638cd |
|
MD5 | 078f847006cc161c1bea15cf9b976ca7 |
|
BLAKE2b-256 | d96b1fab57c4bf5742f5cb3090c4f8b40ed9fb61a77ea5699de046f0d8f1f727 |