示例#1
0
    def test_change_operator(self):
        # user指定
        main([
            self.command_name,
            "change_operator",
            "--project_id",
            project_id,
            "--task_id",
            task_id,
            "--user_id",
            self.user_id,
            "--yes",
        ])

        # 未割り当て
        main([
            self.command_name,
            "change_operator",
            "--project_id",
            project_id,
            "--task_id",
            task_id,
            "--not_assign",
            "--yes",
        ])
示例#2
0
    def test_delete_and_restore_annotation(self):
        backup_dir = str(out_dir / "backup-annotation")
        main([
            "annotation",
            "delete",
            "--project_id",
            project_id,
            "--task_id",
            task_id,
            "--backup",
            backup_dir,
            "--yes",
        ])

        main([
            "annotation",
            "restore",
            "--project_id",
            project_id,
            "--task_id",
            task_id,
            "--annotation",
            backup_dir,
            "--yes",
        ])
示例#3
0
 def test_wait(self):
     main([
         "job",
         "wait",
         "--project_id",
         project_id,
         "--job_type",
         "gen-annotation",
     ])
示例#4
0
 def test_list_task_creation_history(self):
     main([
         "job",
         "list_task_creation_history",
         "--project_id",
         project_id,
         "--output",
         str(out_dir / "list_task_creation_history-out.csv"),
     ])
示例#5
0
 def test_list_history(self):
     main([
         "instruction",
         "list_history",
         "--project_id",
         project_id,
         "--output",
         str(out_dir / "list_history-out.csv"),
     ])
示例#6
0
 def test_list_added_task_history_with_downloading(self):
     out_file = str(out_dir / "task.csv")
     main([
         self.command_name,
         "list_added_task_history",
         "--project_id",
         project_id,
         "--output",
         out_file,
     ])
示例#7
0
 def test_download(self):
     main([
         "instruction",
         "download",
         "--project_id",
         project_id,
         "--output_dir",
         str(out_dir / "download-out"),
         "--download_image",
     ])
示例#8
0
 def test_list_input_data_merged_task_with_json(self):
     out_file = str(out_dir / "task.csv")
     main([
         self.command_name,
         "list_added_task_history",
         "--project_id",
         project_id,
         "--output",
         out_file,
     ])
示例#9
0
 def test_list(self):
     main([
         "annotation",
         "list",
         "--project_id",
         project_id,
         "--task_id",
         task_id,
         "--output",
         str(out_dir / "annotation_count.csv"),
     ])
示例#10
0
 def test_delete(self):
     main([
         "job",
         "delete",
         "--project_id",
         project_id,
         "--job_type",
         "gen-annotation",
         "--job_id",
         "not_exists_job_id",
     ])
示例#11
0
 def test_update_metadata(self):
     main([
         self.command_name,
         "update_metadata",
         "--project_id",
         project_id,
         "--metadata",
         '{"attr1":"foo"}',
         "--task_id",
         task_id,
     ])
示例#12
0
 def test_reject_task(self):
     main([
         self.command_name,
         "reject",
         "--project_id",
         project_id,
         "--task_id",
         task_id,
         "--comment",
         "テストコメント",
         "--yes",
     ])
示例#13
0
 def test_list_inspection_comment_with_json(self):
     main(
         [
             "inspection_comment",
             "list_with_json",
             "--project_id",
             project_id,
             "--exclude_reply",
             "--output",
             str(out_dir / "list_with_json-out.csv"),
         ]
     )
示例#14
0
 def test_list_input_data_merged_task(self):
     out_file = str(out_dir / "input_data.csv")
     main(
         [
             "input_data",
             "list_merged_task",
             "--project_id",
             project_id,
             "--output",
             out_file,
         ]
     )
示例#15
0
 def test_list_last_job(self):
     main([
         "job",
         "list_last",
         "--project_id",
         project_id,
         "--job_type",
         "gen-annotation",
         "--format",
         "csv",
         "--output",
         str(out_dir / "list_last-out.csv"),
     ])
示例#16
0
 def test_list_inspection_comment(self):
     main(
         [
             "inspection_comment",
             "list",
             "--project_id",
             project_id,
             "--task_id",
             task_id,
             "--output",
             str(out_dir / "list-out.csv"),
         ]
     )
示例#17
0
 def test_dashboad(self):
     out_file = str(out_dir / "dashboard.csv")
     main([
         self.command_name,
         "dashboard",
         "--project_id",
         project_id,
         "--date",
         "2020-07-01",
         "--output",
         str(out_file),
         "--yes",
     ])
示例#18
0
 def test_dump_annotation(self):
     output_dir = str(out_dir / "dump-annotation")
     main([
         "annotation",
         "dump",
         "--project_id",
         project_id,
         "--task_id",
         task_id,
         "--output",
         output_dir,
         "--yes",
     ])
示例#19
0
 def test_list_count(self):
     main([
         "annotation",
         "list_count",
         "--project_id",
         project_id,
         "--annotation_query",
         '{"label_name_en": "car"}',
         "--task_id",
         task_id,
         "--output",
         str(out_dir / "annotation_count.csv"),
     ])
示例#20
0
 def test_import(self):
     main([
         "annotation",
         "import",
         "--project_id",
         project_id,
         "--annotation",
         str(data_dir / "imported-annotation.zip"),
         "--task_id",
         task_id,
         "--overwrite",
         "--yes",
     ])
示例#21
0
 def test_update_metadata(self):
     main(
         [
             "input_data",
             "update_metadata",
             "--project_id",
             project_id,
             "--input_data_id",
             self.input_data_id,
             "--metadata",
             '{"attr1":"foo"}',
             "--yes",
         ]
     )
示例#22
0
 def test_list_with_json(self):
     main([
         "task_history",
         "list_with_json",
         "--project_id",
         project_id,
         "--task_id",
         "test1",
         "test2",
         "--output",
         str(out_dir / "list_with_json-out.csv"),
         "--format",
         "csv",
     ])
示例#23
0
    def test_list_task_history(self):

        main([
            "task_history",
            "list",
            "--project_id",
            project_id,
            "--task_id",
            task_id,
            "--format",
            "csv",
            "--output",
            str(out_dir / "list-out.csv"),
        ])
示例#24
0
 def test_list(self):
     out_file = str(out_dir / "task.csv")
     main([
         self.command_name,
         "list",
         "--project_id",
         project_id,
         "--task_query",
         f'{{"user_id": "{self.user_id}", "phase":"acceptance", "status": "complete"}}',
         "--output",
         out_file,
         "--format",
         "csv",
     ])
示例#25
0
 def test_complete_task(self):
     main([
         self.command_name,
         "complete",
         "--project_id",
         project_id,
         "--task_id",
         task_id,
         "--phase",
         "annotation",
         "--reply_comment",
         "対応しました(自動投稿)",
         "--yes",
     ])
示例#26
0
 def test_list_labor_worktime(self):
     out_file = str(out_dir / "list_labor_worktime.csv")
     main([
         self.command_name,
         "list_labor_worktime",
         "--project_id",
         project_id,
         "--start_date",
         "2020-07-01",
         "--end_date",
         "2020-07-02",
         "--output",
         str(out_file),
         "--yes",
     ])
示例#27
0
 def test_list_input_data(self):
     out_file = str(out_dir / "input_data.json")
     main(
         [
             "input_data",
             "list",
             "--project_id",
             project_id,
             "--input_data_query",
             '{"input_data_name": "abcdefg"}',
             "--add_details",
             "--output",
             out_file,
         ]
     )
示例#28
0
 def test_put_input_data_with_zip(self):
     # 注意:ジョブ登録される
     zip_file = str(data_dir / "lenna.zip")
     main(
         [
             "input_data",
             "put",
             "--project_id",
             project_id,
             "--zip",
             zip_file,
             "--wait",
             "--yes",
         ]
     )
示例#29
0
 def test_put_input_data(self):
     csv_file = str(data_dir / "input_data2.csv")
     main(
         [
             "input_data",
             "put",
             "--project_id",
             project_id,
             "--csv",
             csv_file,
             "--overwrite",
             "--yes",
             "--parallelism",
             "2",
         ]
     )
示例#30
0
 def test_list_input_data_with_json(self):
     out_file = str(out_dir / "input_data.csv")
     main(
         [
             "input_data",
             "list_with_json",
             "--project_id",
             project_id,
             "--input_data_query",
             '{"input_data_name": "abcdefg"}',
             "--input_data_id",
             "test1",
             "test2",
             "--output",
             out_file,
         ]
     )