bundle.testing.tools.decorators.data

Attributes

Functions

data(tmp_dir, ref_dir[, cprofile_folder])

Decorator for testing bundle Data model serialization and schema validation.

Module Contents

bundle.testing.tools.decorators.data.logger
bundle.testing.tools.decorators.data.data(tmp_dir: pathlib.Path, ref_dir: str | pathlib.Path, cprofile_folder: str | pathlib.Path | None = None)[source]

Decorator for testing bundle Data model serialization and schema validation.

Wraps test functions to perform round-trip dict and JSON serialization tests, and validates the model against its JSON schema. Tests are profiled using cprofile. Results and errors are logged, with provision for updating reference data.

Parameters:
  • tmp_dir (Path) – Temporary directory for test outputs.

  • ref_dir (str | Path) – Reference directory for baseline data.

  • cprofile_folder (str | Path | None) – Directory for cprofile output.

Returns:

A decorator that wraps test functions to extend their functionality

with serialization and validation tests.

Return type:

Decorator