Apply patch [skip ci]

This commit is contained in:
open-swe[bot]
2025-08-20 07:33:35 +00:00
parent f7a5bdaedb
commit ff183d739b
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -40,7 +40,9 @@ def _parse_version(version: str) -> Version:
patch = "0"
else:
major, minor, patch = parts
return Version(int(major.lstrip("v")), int(minor), int(patch.split("-")[0].split("+")[0]))
return Version(
int(major.lstrip("v")), int(minor), int(patch.split("-")[0].split("+")[0])
)
def check_capabilities(runner) -> DockerCapabilities:
@@ -269,4 +271,3 @@ def compose(
)
compose_str = dict_to_yaml(compose_content)
return compose_str
+3 -3
View File
@@ -365,6 +365,7 @@ services:
POSTGRES_URI: {DEFAULT_POSTGRES_URI}"""
assert clean_empty_lines(actual_compose_str) == expected_compose_str
def test_parse_version_normal_versions():
"""Test _parse_version with normal semantic versions."""
assert _parse_version("1.2.3") == Version(1, 2, 3)
@@ -408,12 +409,11 @@ def test_parse_version_edge_cases():
# Missing patch version
assert _parse_version("1.2") == Version(1, 2, 0)
assert _parse_version("28.1") == Version(28, 1, 0)
# Missing minor and patch versions
assert _parse_version("1") == Version(1, 0, 0)
assert _parse_version("28") == Version(28, 0, 0)
# With 'v' prefix and missing components
assert _parse_version("v1.2") == Version(1, 2, 0)
assert _parse_version("v1") == Version(1, 0, 0)