Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds test code for pydantic models, specifically adding a test for TaskHistory and commenting out a test for Comment due to incorrect swagger.yaml definitions that cause errors.
- Adds a new test function
test__TaskHistory()to verify TaskHistory model functionality - Comments out the
test__Comment()function due to swagger.yaml definition issues - Imports the TaskHistory model to support the new test
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # swagger.yamlの定義が間違っているためエラーが発生する | ||
| # swagger.yamlの定義が修正されるまでコメントアウトする |
There was a problem hiding this comment.
[nitpick] The comment explains why the test is commented out, but it would be more helpful to include a reference to a tracking issue or ticket for when this will be fixed.
| # swagger.yamlの定義が間違っているためエラーが発生する | |
| # swagger.yamlの定義が修正されるまでコメントアウトする | |
| # swagger.yamlの定義が修正されるまでコメントアウトする | |
| # Tracking issue: https://github.com/your-org/your-repo/issues/1234 |
Titlepydanticのテストコードを追加 Description
Changes walkthrough 📝
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
| def test__TaskHistory(): | ||
| content, _ = service.api.get_task_histories(project_id, task_id) | ||
| TaskHistory.from_dict(content[0]) |
There was a problem hiding this comment.
Suggestion: レスポンスのデータ構造に合わせてリストを取得し、要素が存在することをassertで検証してください。また、from_dictの戻り値がTaskHistoryインスタンスであることをチェックすると、テストの信頼性が向上します。 [possible issue, importance: 6]
| def test__TaskHistory(): | |
| content, _ = service.api.get_task_histories(project_id, task_id) | |
| TaskHistory.from_dict(content[0]) | |
| def test__TaskHistory(): | |
| content, _ = service.api.get_task_histories(project_id, task_id) | |
| assert content.get("list"), "タスク履歴が返却されていません" | |
| history = TaskHistory.from_dict(content["list"][0]) | |
| assert isinstance(history, TaskHistory) |
Annofabのswagger.yamlの定義が間違っているため、いくつかのエラーが発生する。
それまでdraftモードにする。