File tree 2 files changed +26
-0
lines changed
packages/ragbits-document-search/tests
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import shutil
2
3
from pathlib import Path
3
4
4
5
import pytest
14
15
TEST_REPO_SSH_URL = "git@github.com:psf/requests.git"
15
16
16
17
18
+ @pytest .fixture (autouse = True )
19
+ def cleanup_test_dirs ():
20
+ """Clean up test directories after each test."""
21
+ yield
22
+ # Get the test directory path
23
+ test_dir = Path (__file__ ).parent
24
+ # Remove the git directory if it exists
25
+ git_dir = test_dir / "git"
26
+ if git_dir .exists ():
27
+ shutil .rmtree (git_dir )
28
+
29
+
17
30
async def test_git_source_fetch_file ():
18
31
"""Test fetching a specific file from a git repository."""
19
32
# Fetch the README.md file
Original file line number Diff line number Diff line change 1
1
import os
2
+ import shutil
2
3
from pathlib import Path
3
4
from unittest .mock import MagicMock , patch
4
5
12
13
os .environ [LOCAL_STORAGE_DIR_ENV ] = Path (__file__ ).parent .as_posix ()
13
14
14
15
16
+ @pytest .fixture (autouse = True )
17
+ def cleanup_test_dirs ():
18
+ """Clean up test directories after each test."""
19
+ yield
20
+ # Get the test directory path
21
+ test_dir = Path (__file__ ).parent
22
+ # Remove the git directory if it exists
23
+ git_dir = test_dir / "git"
24
+ if git_dir .exists ():
25
+ shutil .rmtree (git_dir )
26
+
27
+
15
28
def test_id ():
16
29
"""Test the ID property for GitSource"""
17
30
# Test basic case
You can’t perform that action at this time.
0 commit comments