gpf_entrepot_toolbelt.utils.gpf_test_case module

Usage from the repo root folder:

class gpf_entrepot_toolbelt.utils.gpf_test_case.GpfTestCase(method_name: str = 'runTest')

Bases : TestCase

__init__(method_name: str = 'runTest')

Simple constructor

Paramètres:

method_name (str) – Name of the base metho

assert_files_equals(first_path: Path, second_path: Path)

Assert two files are equals

Paramètres:
  • first_path (Path) – Path to the first file

  • second_path (Path) – Path to the second file

assert_json_files_equals(first_path: Path, second_path: Path, modifiers: dict[str, bool | int | dict] | None = None)

Assert two files are equals accordingly to their JSON content

Paramètres:
  • first_path (Path) – Path to the first file

  • second_path (Path) – Path to the second file

  • modifiers (dict[str, any]) –

    dict containing the field names as keys and as value, one of :

    • boolean : True for nonifying the field

    • int : decimal to keep (or integer digit rounding if negative)

    • dict : For calling recursively the modifying

assert_s3_prefix_contains_exactly(s3_client: GpfS3Client, bucket_name: str, prefix: str, expected_list: list[str])

Assert that a S3 prefix contains exactly all listed files

Paramètres:
  • s3_client (GpfS3Client) – client for the S3 storage

  • bucket_name (str) – Name of the bucket to check

  • prefix (str) – Prefix to check

  • expected_list (list[str]) – relative to prefix list of keys which are expected to be found in the storage