Update cognee/tests/test_path_config.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
e063c49089
commit
3027b01701
1 changed files with 4 additions and 11 deletions
|
|
@ -16,19 +16,12 @@ def test_root_dir_absolute_paths():
|
||||||
|
|
||||||
# Test with relative path (should fail)
|
# Test with relative path (should fail)
|
||||||
rel_path = "relative/path"
|
rel_path = "relative/path"
|
||||||
try:
|
with pytest.raises(ValueError, match="must be absolute"):
|
||||||
ensure_absolute_path(rel_path, allow_relative=False)
|
ensure_absolute_path(rel_path, allow_relative=False)
|
||||||
assert False, "Should fail with relative path when allow_relative=False"
|
|
||||||
except ValueError as e:
|
|
||||||
assert "must be absolute" in str(e)
|
|
||||||
|
|
||||||
# Test with None path
|
|
||||||
try:
|
|
||||||
ensure_absolute_path(None)
|
|
||||||
assert False, "Should fail with None path"
|
|
||||||
except ValueError as e:
|
|
||||||
assert "cannot be None" in str(e)
|
|
||||||
|
|
||||||
|
# Test with None path
|
||||||
|
with pytest.raises(ValueError, match="cannot be None"):
|
||||||
|
ensure_absolute_path(None)
|
||||||
def test_database_relative_paths():
|
def test_database_relative_paths():
|
||||||
"""Test relative path handling for vector and graph databases"""
|
"""Test relative path handling for vector and graph databases"""
|
||||||
system_root = "C:/system/root" if os.name == 'nt' else "/system/root"
|
system_root = "C:/system/root" if os.name == 'nt' else "/system/root"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue