Skip to content

Commit bccde93

Browse files
guidedwaysclaude
andcommitted
fix: make tests version-agnostic to prevent future breakage
- Remove hardcoded version checks in test_server.py - Update test_config.py to check version format instead of specific value - Tests now validate structure/format rather than exact versions - Prevents test failures when bumping versions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4edbf0a commit bccde93

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

tests/test_config.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,23 @@ class TestConfig:
1212
"""Test configuration values"""
1313

1414
def test_version_info(self):
15-
"""Test version information"""
16-
assert __version__ == "2.4.1"
15+
"""Test version information exists and has correct format"""
16+
# Check version format (e.g., "2.4.1")
17+
assert isinstance(__version__, str)
18+
assert len(__version__.split('.')) == 3 # Major.Minor.Patch
19+
20+
# Check author
1721
assert __author__ == "Fahad Gilani"
18-
assert __updated__ == "2025-06-09"
22+
23+
# Check updated date exists and has valid format (YYYY-MM-DD)
24+
assert isinstance(__updated__, str)
25+
assert len(__updated__) == 10
26+
assert __updated__[4] == '-' and __updated__[7] == '-'
27+
# Validate it's a valid date format
28+
year, month, day = __updated__.split('-')
29+
assert len(year) == 4 and year.isdigit()
30+
assert len(month) == 2 and month.isdigit() and 1 <= int(month) <= 12
31+
assert len(day) == 2 and day.isdigit() and 1 <= int(day) <= 31
1932

2033
def test_model_config(self):
2134
"""Test model configuration"""

tests/test_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ async def test_handle_get_version(self):
9292
assert len(result) == 1
9393

9494
response = result[0].text
95-
assert "Gemini MCP Server v2.4.1" in response
95+
assert "Gemini MCP Server v" in response # Version agnostic check
9696
assert "Available Tools:" in response
9797
assert "think_deeper" in response

0 commit comments

Comments
 (0)