Update cognee/tests/test_path_config.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Neeraj Gopalakrishnan 2025-08-29 02:35:48 -07:00 committed by GitHub
parent 19e5980b50
commit d385d7edba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,19 +45,12 @@ def test_database_relative_paths():
assert result == expected
# Test with relative base_path (should fail)
try:
with pytest.raises(ValueError, match="base_path must be absolute"):
ensure_absolute_path(rel_path, base_path="relative/base", allow_relative=True)
assert False, "Should fail when base_path is relative"
except ValueError as e:
assert "base_path must be absolute" in str(e)
# Test without base_path for relative path
try:
with pytest.raises(ValueError, match="base_path must be provided"):
ensure_absolute_path(rel_path, allow_relative=True)
assert False, "Should fail when base_path is not provided for relative path"
except ValueError as e:
assert "base_path must be provided" in str(e)
def test_path_consistency():
"""Test that paths are handled consistently across configurations"""
system_root = "C:/system/root" if os.name == 'nt' else "/system/root"