MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / _is_kuzu_available

Function _is_kuzu_available

tests/test_issue_806_fix.py:27–51  ·  view source on GitHub ↗

Check if configured backend is KuzuDB.

()

Source from the content-addressed store, hash-verified

25
26
27def _is_kuzu_available() -> bool:
28 """Check if configured backend is KuzuDB."""
29 try:
30 import kuzu # noqa: F401
31 except ImportError:
32 return False
33
34 try:
35 from codegraphcontext.cli.config_manager import get_config_value
36
37 configured_backend = get_config_value("DEFAULT_DATABASE")
38
39 # Only run tests if configured backend is kuzudb
40 if configured_backend != "kuzudb":
41 return False
42
43 # Verify KuzuDB can actually connect
44 from codegraphcontext.core.database_kuzu import KuzuDBManager
45
46 db = KuzuDBManager()
47 if db.get_driver() is not None:
48 return True
49 return False
50 except Exception:
51 return False
52
53
54def _get_kuzu_db():

Calls 3

get_config_valueFunction · 0.90
KuzuDBManagerClass · 0.90
get_driverMethod · 0.45

Tested by

no test coverage detected