betty.test_utils.locale module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.test_utils.locale module

Provide testing utilities for locale functionality.

class betty.test_utils.locale.PotFileTestBase

  Bases: `object`

  A base class for testing that a *.pot file is up to date.

  assets_directory_path() → Path

    The assets directory path containing the translations that are being tested.

  command() → str

    The command to suggest the developer runs in case the translations are out of date.

  async test() → None

    Test the translations.

  async update_translations(output_assets_directory_path_override: Path) → None

    Update the translations into the given directory.

class betty.test_utils.locale.ProjectPotFileTestBase

  Bases: `PotFileTestBase`

  A base class for testing that an end user’s project’s *.pot file is up to date.

  assets_directory_path() → Path

    The assets directory path containing the translations that are being tested.

  command() → str

    The command to suggest the developer runs in case the translations are out of date.

  exclude_source_directory_paths() → set[Path]

    The paths to any descendant source directories to exclude.

  project_directory_path() → Path

    Get the path to the directory of the project under test.

  source_directory_path() → Path | None

    The path to a source directory to include.

  async update_translations(output_assets_directory_path_override: Path) → None

    Update the translations into the given directory.