From d385d7edba37fd7b8f177bc3ebe647a1d3aa2d17 Mon Sep 17 00:00:00 2001 From: Neeraj Gopalakrishnan <91423180+gneeraj2001@users.noreply.github.com> Date: Fri, 29 Aug 2025 02:35:48 -0700 Subject: [PATCH] Update cognee/tests/test_path_config.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- cognee/tests/test_path_config.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cognee/tests/test_path_config.py b/cognee/tests/test_path_config.py index 7a3d57e5b..65201fc70 100644 --- a/cognee/tests/test_path_config.py +++ b/cognee/tests/test_path_config.py @@ -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"