Skip to content

Commit

Permalink
Adds test_versioning_check test (#38)
Browse files Browse the repository at this point in the history
* Adds test_versioning_check test

* Fixes MyPy issue
  • Loading branch information
alexthomas93 authored Jan 15, 2025
1 parent c1e5ae4 commit bd0498c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions libs/neo4j/tests/unit_tests/vectorstores/test_neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bd0498c

Please sign in to comment.