Skip to content

test_version_utils

Tests for utility functions regarding version number

test_read_version_number_returns_string_matching_format()

Test read_version_number returns a string, corresponding to the major.minor.patch form.

Source code in tests/business/utils/test_version_utils.py
def test_read_version_number_returns_string_matching_format():
    """Test read_version_number returns a string, corresponding to
    the major.minor.patch form."""

    # Arrange
    # Define the pattern to match the desired format
    pattern = r"^\d+\.\d+\.\d+$"

    # Act
    version_string = utilities.read_version_number()

    # Assert
    assert isinstance(version_string, str)
    assert len(version_string) > 0
    assert re.match(pattern, version_string)