Skip to main content

Test matcher for protobuffer

Project description

proto-matcher

Test matchers for Protobuffer in Python.

This is based on MessageDifferencer as well as the EqualsProto googletest matcher.

API

This packages provides the following PyHamcrest 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proto_matcher-0.0.3.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

proto_matcher-0.0.3-py3-none-any.whl (13.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page