swaggerconformance package

Module contents

This package enables easy testing of Swagger Spec defined APIs using property based tests and by generating paramter values meeting the specification.

This top-level package exposes functions for basic API tests just requiring access to the API schema.

Subpackages and modules then provide classes and functions for finer grain control over value generation and test procedures.

swaggerconformance.api_conformance_test(schema_path, num_tests_per_op=20, cont_on_err=True)[source]

Basic test of the conformance of the API defined by the given schema.

  • schema_path (str) – The path to / URL of the schema to validate.
  • num_tests_per_op (int) – How many tests to run of each API operation.
  • cont_on_err (bool) – Validate all operations, or drop out on first error.
swaggerconformance.operation_conformance_test(client, operation, num_tests=20)[source]

Test the conformance of the given operation using the provided client.

  • client (client.Client) – The client to use to access the API.
  • operation (schema.Operation) – The operation to test.
  • num_tests (int) – How many tests to run of each API operation.