Skip to content

pydanticのテストコードを追加 #702

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/test_pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from annofabapi.pydantic_models.simple_annotation import SimpleAnnotation
from annofabapi.pydantic_models.single_annotation import SingleAnnotation
from annofabapi.pydantic_models.task import Task
from annofabapi.pydantic_models.task_history import TaskHistory

inifile = configparser.ConfigParser()
inifile.read("./pytest.ini", "UTF-8")
Expand All @@ -35,6 +36,21 @@ def test__Task():
Task.from_dict(task)


def test__TaskHistory():
content, _ = service.api.get_task_histories(project_id, task_id)
TaskHistory.from_dict(content[0])


# swagger.yamlの定義が間違っているためエラーが発生する
# swagger.yamlの定義が修正されるまでコメントアウトする
# def test__Comment():
# with tempfile.NamedTemporaryFile() as temp_file:
# service.wrapper.download_project_comments_url(project_id, temp_file.name)
# with open(temp_file.name) as f:
# comments = json.load(f)
# Comment.from_dict(comments[0])


def test__InputData():
content, _ = service.api.get_input_data_list(project_id)
input_data = content["list"][0]
Expand Down
Loading