mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 18:15:02 +00:00
test: list route keeps agents with neither source nor retriever
The coverage suite still asserted the old filter that hid such agents from /api/get_agents. They are listed now, so the test checks that.
This commit is contained in:
1 parent
0fe059db12
commit
9778910abe
1 file changed
+6
-6
@@ -341,8 +341,9 @@ class TestSeederExtra:
|
||||
|
||||
|
||||
class TestAgentsRoutesRemainingGaps:
|
||||
def test_get_agents_filters_out_incomplete(self, app, pg_conn):
|
||||
"""Agents missing both source and retriever are filtered from the list."""
|
||||
def test_get_agents_lists_source_less_agents(self, app, pg_conn):
|
||||
"""An agent with neither source nor retriever is still listed: it
|
||||
skips retrieval at run time and answers from the model and tools."""
|
||||
from docsgpt.api.user.agents.routes import GetAgents
|
||||
from docsgpt.storage.db.repositories.agents import AgentsRepository
|
||||
|
||||
@@ -351,12 +352,11 @@ class TestAgentsRoutesRemainingGaps:
|
||||
yield pg_conn
|
||||
|
||||
user = "u-filter"
|
||||
# Complete agent: has retriever
|
||||
AgentsRepository(pg_conn).create(
|
||||
user, "ok", "published", retriever="classic",
|
||||
)
|
||||
# Incomplete agent: no source, no retriever, not workflow type
|
||||
AgentsRepository(pg_conn).create(user, "bad", "published")
|
||||
# No source, no retriever, not a workflow agent.
|
||||
AgentsRepository(pg_conn).create(user, "bare", "published")
|
||||
|
||||
with patch(
|
||||
"docsgpt.api.user.agents.routes.db_session", _yield
|
||||
@@ -369,4 +369,4 @@ class TestAgentsRoutesRemainingGaps:
|
||||
assert response.status_code == 200
|
||||
names = [a["name"] for a in response.json]
|
||||
assert "ok" in names
|
||||
assert "bad" not in names
|
||||
assert "bare" in names
|
||||
Reference in new issue
Block a user