From bccde9307fbf2449b5da9e87489bfe23e9a6638a Mon Sep 17 00:00:00 2001 From: Fahad Date: Mon, 9 Jun 2025 05:36:38 +0400 Subject: [PATCH] fix: make tests version-agnostic to prevent future breakage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- tests/test_config.py | 19 ++++++++++++++++--- tests/test_server.py | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 25c633f..6c1c26e 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -12,10 +12,23 @@ class TestConfig: """Test configuration values""" def test_version_info(self): - """Test version information""" - assert __version__ == "2.4.1" + """Test version information exists and has correct format""" + # Check version format (e.g., "2.4.1") + assert isinstance(__version__, str) + assert len(__version__.split('.')) == 3 # Major.Minor.Patch + + # Check author assert __author__ == "Fahad Gilani" - assert __updated__ == "2025-06-09" + + # Check updated date exists and has valid format (YYYY-MM-DD) + assert isinstance(__updated__, str) + assert len(__updated__) == 10 + assert __updated__[4] == '-' and __updated__[7] == '-' + # Validate it's a valid date format + year, month, day = __updated__.split('-') + assert len(year) == 4 and year.isdigit() + assert len(month) == 2 and month.isdigit() and 1 <= int(month) <= 12 + assert len(day) == 2 and day.isdigit() and 1 <= int(day) <= 31 def test_model_config(self): """Test model configuration""" diff --git a/tests/test_server.py b/tests/test_server.py index f533620..5005272 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -92,6 +92,6 @@ class TestServerTools: assert len(result) == 1 response = result[0].text - assert "Gemini MCP Server v2.4.1" in response + assert "Gemini MCP Server v" in response # Version agnostic check assert "Available Tools:" in response assert "think_deeper" in response