mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 18:15:02 +00:00
fix: tests
This commit is contained in:
1 parent
a9761061fc
commit
b5b6538762
3 files changed
+4
-2
No files matched your search
@@ -31,6 +31,7 @@ class TestGitHubLoaderFetchFileContent:
|
||||
mock_get.assert_called_once_with(
|
||||
"https://api.github.com/repos/owner/repo/contents/README.md",
|
||||
headers=loader.headers,
|
||||
timeout=100,
|
||||
)
|
||||
|
||||
@patch("application.parser.remote.github_loader.requests.get")
|
||||
@@ -66,7 +67,7 @@ class TestGitHubLoaderFetchRepoFiles:
|
||||
def test_recurses_directories(self, mock_get):
|
||||
loader = GitHubLoader()
|
||||
|
||||
def side_effect(url, headers=None):
|
||||
def side_effect(url, headers=None, timeout=None):
|
||||
if url.endswith("/contents/"):
|
||||
return make_response([
|
||||
{"type": "file", "path": "README.md"},
|
||||
|
||||
@@ -342,7 +342,7 @@ class TestDownloadFile:
|
||||
dest = str(tmp_path / "downloaded.txt")
|
||||
download_file("http://example.com/file", {"key": "val"}, dest)
|
||||
|
||||
mock_get.assert_called_once_with("http://example.com/file", params={"key": "val"})
|
||||
mock_get.assert_called_once_with("http://example.com/file", params={"key": "val"}, timeout=100)
|
||||
with open(dest, "rb") as f:
|
||||
assert f.read() == b"file content"
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ class TestPGVectorStoreInit:
|
||||
mock_get_emb.return_value = Mock(dimension=768)
|
||||
mock_settings.EMBEDDINGS_NAME = "test_model"
|
||||
mock_settings.PGVECTOR_CONNECTION_STRING = None
|
||||
mock_settings.POSTGRES_URI = None
|
||||
|
||||
from application.vectorstore.pgvector import PGVectorStore
|
||||
|
||||
|
||||
Reference in new issue
Block a user