Pact Testing

Common pact-python test fixtures

For use with pact-python

API Reference

class xocto.pact_testing.PactConsumerClient(base_url: str)[source]

Bases: object

post(path: str, data: dict[str, Any], token: str | None = None) dict[str, Any][source]
class xocto.pact_testing.PactOptions(broker_url: 'str', broker_username: 'str', broker_password: 'str', consumer_name: 'str', provider_name: 'str', consumer_version: 'str', log_path: 'str')[source]

Bases: object

broker_password: str
broker_url: str
broker_username: str
consumer_name: str
consumer_version: str
log_path: str
provider_name: str
xocto.pact_testing.get_git_branch_name() str | None[source]

Get the current git branch name.

xocto.pact_testing.get_unique_version_hash() str | None[source]

Get a unique version number for the pact verification for the current git revision.

  • Get git hash for the current git revision.

xocto.pact_testing.pact_service(*, options: PactOptions, publish_to_broker: bool) Pact[source]