import pytest

from aiservice.common_utils import parse_python_version


def test_python_version():
    assert parse_python_version("3.9.0") == (3, 9, 0)
    assert parse_python_version("3.12.2") == (3, 12, 2)
    with pytest.raises(ValueError):
        parse_python_version("3.9")
    with pytest.raises(AssertionError):
        parse_python_version("2.7.2")
    with pytest.raises(Exception):
        parse_python_version("hi.there.hello")
    with pytest.raises(AssertionError):
        parse_python_version("3.1231231129.23432412312312313212412131212122112")
