1+ """Unit tests for cypher_tools module."""
2+
3+ import inspect
4+ import pytest
5+
6+ from agentic_kg .tools .cypher_tools import get_neo4j_import_dir
7+
8+
9+ def test_get_neo4j_import_dir_query_contains_correct_filter ():
10+ """Test that get_neo4j_import_dir function uses the correct filter for configuration names.
11+
12+ This test ensures the function searches for 'directories.import' which matches both:
13+ - server.directories.import (traditional configuration)
14+ - dbms.directories.import (Community Edition configuration)
15+ """
16+ # Get the source code of the function
17+ source = inspect .getsource (get_neo4j_import_dir )
18+
19+ # Verify the query contains the correct filter
20+ assert "WHERE name CONTAINS 'directories.import'" in source , (
21+ "Function should filter for 'directories.import' to match both "
22+ "'server.directories.import' and 'dbms.directories.import'"
23+ )
24+
25+ # Verify it doesn't contain the old, more restrictive filter
26+ assert "WHERE name CONTAINS 'server.directories.import'" not in source , (
27+ "Function should not use the restrictive 'server.directories.import' filter"
28+ )
29+
30+
31+ def test_get_neo4j_import_dir_function_signature ():
32+ """Test that the function signature hasn't changed."""
33+ # Verify the function exists and has the expected signature
34+ assert callable (get_neo4j_import_dir )
35+
36+ # Check that it takes no parameters
37+ sig = inspect .signature (get_neo4j_import_dir )
38+ assert len (sig .parameters ) == 0 , "Function should take no parameters"
0 commit comments