diff --git a/libs/neo4j/tests/unit_tests/vectorstores/test_neo4j.py b/libs/neo4j/tests/unit_tests/vectorstores/test_neo4j.py index 3b21268..a75fa40 100644 --- a/libs/neo4j/tests/unit_tests/vectorstores/test_neo4j.py +++ b/libs/neo4j/tests/unit_tests/vectorstores/test_neo4j.py @@ -139,6 +139,34 @@ def _create_vector_store( return _create_vector_store +@pytest.mark.parametrize( + "description, version, is_5_23_or_above", + [ + ("SemVer, < 5.23", "5.22.0", False), + ("SemVer, > 5.23", "5.24.0", True), + ("SemVer, < 5.23, Aura", "5.22-aura", False), + ("SemVer, > 5.23, Aura", "5.24-aura", True), + ("CalVer", "2025.01.0", True), + ("CalVer, Aura", "2025.01-aura", True), + ], +) +def test_versioning_check( + mock_vector_store: Neo4jVector, + description: str, + version: str, + is_5_23_or_above: bool, +) -> None: + with patch.object(mock_vector_store, "query"): + assert isinstance(mock_vector_store.query, MagicMock) + mock_vector_store.query.return_value = [ + {"versions": [version], "edition": "enterprise"} + ] + mock_vector_store.verify_version() + assert ( + mock_vector_store.neo4j_version_is_5_23_or_above is is_5_23_or_above + ), f"Failed test case: {description}" + + def test_escaping_lucene() -> None: """Test escaping lucene characters""" assert remove_lucene_chars("Hello+World") == "Hello World"