Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(agents-api): Fixed tests for models and queries #449

Merged
merged 5 commits into from
Aug 9, 2024

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented Aug 9, 2024

  • refactor(agents-api): Move tests to root dir
  • Update test files to reflect new location of model functions
  • Remove DeleteDocRequest import and related tests from test_docs_queries.py
  • fix(agents-api): Fixed tests

🚀 This description was created by Ellipsis for commit ad27ec0

Summary:

Refactored and relocated test files for agents-api, updated model function locations, and modified exception handling and query construction.

Key points:

  • Refactored and moved test files to the root directory.
  • Updated test files to reflect new locations of model functions.
  • Removed DeleteDocRequest import and related tests from agents-api/agents_api/models/docs/test_docs_queries.py.
  • Modified exception handling in create_agent.py, delete_agent.py, get_agent.py, and others.
  • Adjusted query construction in delete_doc.py, create_entries.py, create_execution.py, and others.
  • Updated fixtures in agents-api/tests/fixtures.py to support new test setup.

Generated with ❤️ by ellipsis.dev

Diwank Tomer and others added 5 commits August 9, 2024 10:44
* **agents-api/tests/test_agent_queries.py**
  - Update import statements to reflect the new location of the model functions
  - Update function calls to the new location of the model functions
  - Add `from agents_api.autogen.openapi_model import Agent` back

* **agents-api/tests/test_docs_queries.py**
  - Update import statements to reflect the new location of the model functions

* **agents-api/tests/test_entry_queries.py**
  - Update import statements to reflect the new location of the model functions

* **agents-api/tests/test_execution_queries.py**
  - Update import statements to reflect the new location of the model functions

* **agents-api/tests/test_session_queries.py**
  - Update import statements to reflect the new location of the model functions

* **agents-api/tests/test_task_queries.py**
  - Update import statements to reflect the new location of the model functions

* **agents-api/tests/test_tool_queries.py**
  - Update import statements to reflect the new location of the model functions

* **agents-api/tests/test_user_queries.py**
  - Update import statements to reflect the new location of the model functions
…eries.py`

Update tests in `test_agent_queries.py` to use existing models and queries
* Replace `agent.create_agent` with `create_agent`
* Replace `agent.delete_agent` with `delete_agent`
* Replace `agent.get_agent` with `get_agent`
* Replace `agent.list_agents` with `list_agents`
* Replace `agent.update_agent` with `update_agent`

Update tests in `test_session_queries.py` to use existing models and queries
* Import `Session` from `agents_api.autogen.openapi_model`

Update tests in `test_task_queries.py` to use existing models and queries
* Replace `CreateTaskRequest`, `DeleteTaskRequest`, `GetTaskRequest`, `ListTasksRequest`, `UpdateTaskRequest` with dictionaries

Update tests in `test_tool_queries.py` to use existing models and queries
* Replace `FunctionDef` with dictionaries

Update tests in `test_user_queries.py` to use existing models and queries
* Replace `agents_api.autogen.openapi_model` with `agents_api.autogen.Users`
Signed-off-by: Diwank Tomer <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to ad27ec0 in 1 minute and 3 seconds

More details
  • Looked at 3034 lines of code in 26 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. agents-api/agents_api/models/agent/delete_agent.py:29
  • Draft comment:
    The HTTP status code for "developer not found or doesn't own resource" should be 404 (Not Found) instead of 403 (Forbidden) as it directly relates to the inability to locate a resource (developer or agent) specified by the client.
            detail="developer not found or doesnt own resource", status_code=404
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.
2. agents-api/agents_api/models/agent/get_agent.py:24
  • Draft comment:
    The HTTP status code for "developer not found or doesn't own resource" should be 404 (Not Found) instead of 403 (Forbidden) as it directly relates to the inability to locate a resource (developer or agent) specified by the client.
            detail="developer not found or doesnt own resource", status_code=404
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_JHxoYrURlNmRAKNo


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@creatorrr creatorrr merged commit db58349 into dev-tasks-disable-routes Aug 9, 2024
2 of 6 checks passed
@creatorrr creatorrr deleted the x/agents-api-tests branch August 9, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant