-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wrapper.put_annotation_for_simple_annotation_jsonに、アノテーション仕様V2版を指定できる…
…ようにする (#313) * update pyproject.toml * annofab v0.111.0 * extensionを追加 * wrapper: put_annotation_for_simple_annotation_jsonをV2版のアノテーション仕様にも対応させる * format * update wrapper * spellチェックの設定を追加 * lint設定 * typo * test code追加 * devcontainerの更新 * 修正 * pytestで無視するファイルを設定 * ".netrc"ファイルが必要なテストを除く。テストしづらいため。 * update travis * updatetravis * update travis * update travis * version up
- Loading branch information
1 parent
54ffddb
commit 1bce988
Showing
12 changed files
with
164 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"version": "0.1", | ||
"ignorePaths": [ | ||
"**/.git/objects/**", | ||
".devcontainer/", | ||
".vscode/", | ||
"LICENSE", | ||
"tests/", | ||
// 以下は自動生成されるファイルなのでチェックしない | ||
"generated_*.py", | ||
"models.py", | ||
"annofabapi/dataclass/*.py" | ||
], | ||
"enabledLanguageIds": [ | ||
"python" | ||
], | ||
"words": [ | ||
"additionals", | ||
"astimezone", | ||
"asyncio", | ||
"dateutil", | ||
"pylint", | ||
"tzlocal" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.45.0" | ||
__version__ = "0.45.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
""" | ||
AnnoFabプロジェクトやタスクに大きく依存したテストコードです。 | ||
""" | ||
import configparser | ||
import datetime | ||
import os | ||
import uuid | ||
|
||
import pytest | ||
import requests | ||
from more_itertools import first_true | ||
|
||
import annofabapi | ||
import annofabapi.utils | ||
from annofabapi.models import GraphType, JobType | ||
from tests.utils_for_test import WrapperForTest, create_csv_for_task | ||
|
||
# プロジェクトトップに移動する | ||
os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/../") | ||
inifile = configparser.ConfigParser() | ||
inifile.read("./pytest.ini", "UTF-8") | ||
|
||
project_id = inifile["annofab"]["project_id"] | ||
task_id = inifile["annofab"]["task_id"] | ||
|
||
|
||
test_dir = "./tests/data" | ||
out_dir = "./tests/out" | ||
|
||
endpoint_url = inifile["annofab"].get("endpoint_url", None) | ||
if endpoint_url is not None: | ||
service = annofabapi.build(endpoint_url=endpoint_url) | ||
else: | ||
service = annofabapi.build() | ||
|
||
|
||
class TestAnnotation: | ||
def test_wrapper_put_annotation_for_simple_annotation_json_v1(self): | ||
"""2021/07以降に廃止する予定""" | ||
project_id = "bf530c4e-1185-4a0c-994f-502fb01ea37e" | ||
annotation_specs_v1, _ = service.api.get_annotation_specs(project_id, query_params={"v": "1"}) | ||
service.wrapper.put_annotation_for_simple_annotation_json( | ||
project_id=project_id, | ||
task_id="sample_0", | ||
input_data_id="0733d1e1-ef85-455e-aec0-ff05c499b711", | ||
simple_annotation_json=str( | ||
test_dir + "/simple-annotation/sample_1/c6e1c2ec-6c7c-41c6-9639-4244c2ed2839.json" | ||
), | ||
annotation_specs_labels=annotation_specs_v1["labels"], | ||
) | ||
|
||
def test_wrapper_put_annotation_for_simple_annotation_json_v2(self): | ||
project_id = "bf530c4e-1185-4a0c-994f-502fb01ea37e" | ||
annotation_specs_v2, _ = service.api.get_annotation_specs(project_id, query_params={"v": "2"}) | ||
service.wrapper.put_annotation_for_simple_annotation_json( | ||
project_id=project_id, | ||
task_id="sample_0", | ||
input_data_id="0733d1e1-ef85-455e-aec0-ff05c499b711", | ||
simple_annotation_json=str( | ||
test_dir + "/simple-annotation/sample_1/c6e1c2ec-6c7c-41c6-9639-4244c2ed2839.json" | ||
), | ||
annotation_specs_labels=annotation_specs_v2["labels"], | ||
annotation_specs_additionals=annotation_specs_v2["additionals"], | ||
) |