mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 00:16:46 +00:00
Pg 4 (#2390)
* feat: postgres tests * feat: mongo cutoff * feat: mongo cutoff * feat: adjust docs and compose files * fix: mini code mongo removals * fix: tests and k8s mongo stuff * feat: test fixes * fix: ruff * fix: vale * Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix: mini suggestions * vale lint fix 2 * fix: codeql columns thing * fix: test mongo * fix: tests coverage * feat: better tests 4 * feat: more tests * feat: decent coverage * fix: ruff fixes * fix: remove mongo mock * feat: enhance workflow engine and API routes; add document retrieval and source handling * feat: e2e tests * fix: mcp, mongo and more * fix: mini codeql warning * fix: agent chunk view * fix: mini issues * fix: more pg fixes * feat: postgres prep on start * feat: qa tests * fix: mini improvements * fix: tests --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Siddhant Rai <siddhant.rai.5686@gmail.com>
This commit is contained in:
312 files changed
+763725
-25159
No files matched your search
@@ -51,38 +51,6 @@ class TestCeleryInitConfigLoggers:
|
||||
mock_setup.assert_called()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# application/core/mongo_db.py (lines 22-24)
|
||||
# ---------------------------------------------------------------------------
|
||||
@pytest.mark.unit
|
||||
class TestMongoDBCloseClient:
|
||||
def test_close_client_when_connected(self):
|
||||
"""Cover lines 22-24: close_client closes and sets to None."""
|
||||
from application.core.mongo_db import MongoDB
|
||||
|
||||
mock_client = MagicMock()
|
||||
original = MongoDB._client
|
||||
try:
|
||||
MongoDB._client = mock_client
|
||||
MongoDB.close_client()
|
||||
mock_client.close.assert_called_once()
|
||||
assert MongoDB._client is None
|
||||
finally:
|
||||
MongoDB._client = original
|
||||
|
||||
def test_close_client_when_not_connected(self):
|
||||
"""Cover: close_client is no-op when _client is None."""
|
||||
from application.core.mongo_db import MongoDB
|
||||
|
||||
original = MongoDB._client
|
||||
try:
|
||||
MongoDB._client = None
|
||||
MongoDB.close_client() # Should not raise
|
||||
assert MongoDB._client is None
|
||||
finally:
|
||||
MongoDB._client = original
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# application/llm/docsgpt_provider.py (lines 10, 29, 51)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user