From ab594a3f90b5cea588d818b600fe2a97e3557c0b Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Wed, 20 Aug 2025 07:30:14 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/cli/test_fix.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libs/cli/test_fix.py diff --git a/libs/cli/test_fix.py b/libs/cli/test_fix.py new file mode 100644 index 000000000..7768c3f71 --- /dev/null +++ b/libs/cli/test_fix.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +"""Test script to verify the _parse_version fix works correctly.""" + +from langgraph_cli.docker import _parse_version + +def test_version_parsing(): + """Test various version formats to ensure the fix works.""" + test_cases = [ + ('28.1.1', (28, 1, 1)), + ('28.1.1+1', (28, 1, 1)), # This was the failing case + ('1.2.3-alpha', (1, 2, 3)), + ('1.2.3+build', (1, 2, 3)), + ('1.2.3-alpha+build', (1, 2, 3)), + ('v1.2.3', (1, 2, 3)), + ('1.2', (1, 2, 0)), + ('1', (1, 0, 0)), + ] + + print("Testing _parse_version function:") + for version_str, expected in test_cases: + try: + result = _parse_version(version_str) + actual = (result.major, result.minor, result.patch) + status = "✓" if actual == expected else "✗" + print(f"{status} {version_str:15} -> {actual} (expected {expected})") + except Exception as e: + print(f"✗ {version_str:15} -> ERROR: {e}") + +if __name__ == "__main__": + test_version_parsing()