datawow 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +59 -0
- data/INSTALL.md +7 -0
- data/README/ai_docs.md +153 -0
- data/README/image_docs.md +119 -0
- data/README/text_docs.md +83 -0
- data/README/video_docs.md +53 -0
- data/README.md +160 -0
- data/Rakefile +12 -0
- data/datawow.gemspec +28 -0
- data/lib/datawow/client_response.rb +18 -0
- data/lib/datawow/connection.rb +99 -0
- data/lib/datawow/connector.rb +118 -0
- data/lib/datawow/error.rb +15 -0
- data/lib/datawow/faraday/raise_http_exception.rb +40 -0
- data/lib/datawow/models/images/image_choices.rb +16 -0
- data/lib/datawow/models/images/image_closed_questions.rb +16 -0
- data/lib/datawow/models/images/image_messages.rb +16 -0
- data/lib/datawow/models/images/image_photo_tags.rb +16 -0
- data/lib/datawow/models/images/nanameue_human.rb +16 -0
- data/lib/datawow/models/interface.rb +26 -0
- data/lib/datawow/models/predictions/predictors.rb +18 -0
- data/lib/datawow/models/texts/text_categories.rb +16 -0
- data/lib/datawow/models/texts/text_closed_questions.rb +16 -0
- data/lib/datawow/models/texts/text_conversations.rb +16 -0
- data/lib/datawow/models/videos/video_classifications.rb +17 -0
- data/lib/datawow/version.rb +3 -0
- data/lib/datawow.rb +75 -0
- data/lib/generators/datawow/install_generator.rb +18 -0
- data/lib/generators/templates/datawow_api.rb +5 -0
- data/test/datawow/client_response_test.rb +29 -0
- data/test/datawow/connection_test.rb +85 -0
- data/test/datawow/connector_test.rb +79 -0
- data/test/datawow/image_choices_test.rb +48 -0
- data/test/datawow/image_closed_questions_test.rb +47 -0
- data/test/datawow/image_messages_test.rb +48 -0
- data/test/datawow/image_photo_tags_test.rb +48 -0
- data/test/datawow/nanameue_human_test.rb +47 -0
- data/test/datawow/predictors_test.rb +48 -0
- data/test/datawow/text_categories_test.rb +48 -0
- data/test/datawow/text_closed_questions_test.rb +48 -0
- data/test/datawow/text_conversations_test.rb +48 -0
- data/test/datawow/video_classifications_test.rb +48 -0
- data/test/datawow_test.rb +34 -0
- data/test/fixtures/image_choice/all.json +27 -0
- data/test/fixtures/image_choice/create.json +25 -0
- data/test/fixtures/image_closed_question/all.json +21 -0
- data/test/fixtures/image_closed_question/create.json +19 -0
- data/test/fixtures/image_message/all.json +22 -0
- data/test/fixtures/image_message/create.json +20 -0
- data/test/fixtures/image_photo_tag/all.json +22 -0
- data/test/fixtures/image_photo_tag/create.json +20 -0
- data/test/fixtures/nanameue_human/all.json +25 -0
- data/test/fixtures/nanameue_human/create.json +21 -0
- data/test/fixtures/prediction/all.json +21 -0
- data/test/fixtures/prediction/create.json +19 -0
- data/test/fixtures/text_category/all.json +34 -0
- data/test/fixtures/text_category/create.json +27 -0
- data/test/fixtures/text_closed_question/all.json +27 -0
- data/test/fixtures/text_closed_question/create.json +20 -0
- data/test/fixtures/text_conversation/all.json +33 -0
- data/test/fixtures/text_conversation/create.json +26 -0
- data/test/fixtures/video_classification/all.json +21 -0
- data/test/fixtures/video_classification/create.json +19 -0
- data/test/helper/file_reader.rb +11 -0
- data/test/test_helper.rb +59 -0
- metadata +254 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"images": [
|
4
|
+
{
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
6
|
+
"allow_empty": false,
|
7
|
+
"answer": [],
|
8
|
+
"categories": [
|
9
|
+
"Gnoon"
|
10
|
+
],
|
11
|
+
"credit_charged": 0,
|
12
|
+
"custom_id": null,
|
13
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
14
|
+
"instruction": "Instruction",
|
15
|
+
"multiple": false,
|
16
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
17
|
+
"processed_at": null,
|
18
|
+
"project_id": 102,
|
19
|
+
"status": "unprocess"
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"meta": {
|
24
|
+
"code": 200,
|
25
|
+
"message": "success"
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"image": {
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
5
|
+
"allow_empty": false,
|
6
|
+
"answer": [],
|
7
|
+
"categories": [
|
8
|
+
"foo,bar"
|
9
|
+
],
|
10
|
+
"credit_charged": 0,
|
11
|
+
"custom_id": null,
|
12
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
13
|
+
"instruction": "Image's instruction",
|
14
|
+
"multiple": false,
|
15
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
16
|
+
"processed_at": null,
|
17
|
+
"project_id": 105,
|
18
|
+
"status": "unprocess"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"meta": {
|
22
|
+
"code": 200,
|
23
|
+
"message": "success"
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"images": [
|
4
|
+
{
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
6
|
+
"answer": "declined",
|
7
|
+
"credit_charged": 1,
|
8
|
+
"custom_id": null,
|
9
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
10
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
11
|
+
"processed_at": "2017-12-28T10:40:30.462+07:00",
|
12
|
+
"project_id": 102,
|
13
|
+
"status": "processed"
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"meta": {
|
18
|
+
"code": 200,
|
19
|
+
"message": "success"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"image": {
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
5
|
+
"answer": "declined",
|
6
|
+
"credit_charged": 1,
|
7
|
+
"custom_id": null,
|
8
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
9
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
10
|
+
"processed_at": "2017-12-28T10:40:30.462+07:00",
|
11
|
+
"project_id": 102,
|
12
|
+
"status": "processed"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"meta": {
|
16
|
+
"code": 200,
|
17
|
+
"message": "success"
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"images": [
|
4
|
+
{
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
6
|
+
"answer": null,
|
7
|
+
"credit_charged": 0,
|
8
|
+
"custom_id": null,
|
9
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
10
|
+
"instruction": "Instruction",
|
11
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
12
|
+
"processed_at": null,
|
13
|
+
"project_id": 102,
|
14
|
+
"status": "unprocess"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
},
|
18
|
+
"meta": {
|
19
|
+
"code": 200,
|
20
|
+
"message": "success"
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"image": {
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
5
|
+
"answer": null,
|
6
|
+
"credit_charged": 0,
|
7
|
+
"custom_id": null,
|
8
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
9
|
+
"instruction": "Instruction",
|
10
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
11
|
+
"processed_at": null,
|
12
|
+
"project_id": 102,
|
13
|
+
"status": "unprocess"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"meta": {
|
17
|
+
"code": 200,
|
18
|
+
"message": "success"
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"images": [
|
4
|
+
{
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
6
|
+
"answer": [],
|
7
|
+
"credit_charged": 0,
|
8
|
+
"custom_id": null,
|
9
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
10
|
+
"instruction": "Instruction",
|
11
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
12
|
+
"processed_at": null,
|
13
|
+
"project_id": 102,
|
14
|
+
"status": "unprocess"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
},
|
18
|
+
"meta": {
|
19
|
+
"code": 200,
|
20
|
+
"message": "success"
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"image": {
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
5
|
+
"answer": [],
|
6
|
+
"credit_charged": 0,
|
7
|
+
"custom_id": null,
|
8
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
9
|
+
"instruction": "Instruction",
|
10
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
11
|
+
"processed_at": null,
|
12
|
+
"project_id": 102,
|
13
|
+
"status": "unprocess"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"meta": {
|
17
|
+
"code": 200,
|
18
|
+
"message": "success"
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"images": [
|
4
|
+
{
|
5
|
+
"id": "5c218fcc1eda3f457430ee45",
|
6
|
+
"answer": "approved",
|
7
|
+
"credit_charged": 0,
|
8
|
+
"custom_id": null,
|
9
|
+
"data": "data",
|
10
|
+
"mode": "human",
|
11
|
+
"created_at": "2018-12-25T09:02:52.650+07:00",
|
12
|
+
"postback": true,
|
13
|
+
"postback_url": "https://datawow.io",
|
14
|
+
"processed_at": "2018-12-28T12:30:06.415+07:00",
|
15
|
+
"project_id": 199,
|
16
|
+
"staff_id": null,
|
17
|
+
"status": "processed"
|
18
|
+
}
|
19
|
+
]
|
20
|
+
},
|
21
|
+
"meta": {
|
22
|
+
"code": 200,
|
23
|
+
"message": "success"
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"id": "5c218fcc1eda3f457430ee45",
|
4
|
+
"answer": null,
|
5
|
+
"credit_charged": 0,
|
6
|
+
"custom_id": null,
|
7
|
+
"data": "data",
|
8
|
+
"mode": "human",
|
9
|
+
"created_at": "2018-12-25T09:02:52.650+07:00",
|
10
|
+
"postback": true,
|
11
|
+
"postback_url": "https://datawow.io",
|
12
|
+
"processed_at": null,
|
13
|
+
"project_id": 199,
|
14
|
+
"staff_id": null,
|
15
|
+
"status": "unprocess"
|
16
|
+
},
|
17
|
+
"meta": {
|
18
|
+
"code": 201,
|
19
|
+
"message": "created success"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"image": [
|
4
|
+
{
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
6
|
+
"answer": "approved",
|
7
|
+
"credit_charged": 0,
|
8
|
+
"custom_id": null,
|
9
|
+
"data": "https://s3-ap-northeast-1.amazonaws.com/marinchat/uploads/user/6951939/profile_icon/veOSbIBCR.jpg",
|
10
|
+
"postback_url": "http://localhost:3000/projects",
|
11
|
+
"processed_at": "2017-11-16T10:10:56.282+07:00",
|
12
|
+
"project_id": 93,
|
13
|
+
"status": "processed"
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"meta": {
|
18
|
+
"code": 200,
|
19
|
+
"message": "success"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"image": {
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
5
|
+
"answer": "approved",
|
6
|
+
"credit_charged": 0,
|
7
|
+
"custom_id": null,
|
8
|
+
"data": "https://s3-ap-northeast-1.amazonaws.com/marinchat/uploads/user/6951939/profile_icon/veOSbIBCR.jpg",
|
9
|
+
"postback_url": "http://localhost:3000/projects",
|
10
|
+
"processed_at": "2017-11-16T10:10:56.282+07:00",
|
11
|
+
"project_id": 93,
|
12
|
+
"status": "processed"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"meta": {
|
16
|
+
"code": 200,
|
17
|
+
"message": "success"
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"data": [
|
3
|
+
{
|
4
|
+
"id": "5b7ce9085a5e43fb0775be86",
|
5
|
+
"custom_id": "string",
|
6
|
+
"title": "string",
|
7
|
+
"status": "unprocessed",
|
8
|
+
"conversation": [
|
9
|
+
{
|
10
|
+
"name": "string",
|
11
|
+
"message": "string"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"categories": [],
|
15
|
+
"staff_id": null,
|
16
|
+
"postback_url": "string",
|
17
|
+
"postback_method": "string",
|
18
|
+
"project_id": 159,
|
19
|
+
"processed_at": null,
|
20
|
+
"allow_empty": false,
|
21
|
+
"created_at": "2018-08-22T11:39:36.885+07:00",
|
22
|
+
"qa_status": null
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"meta": {
|
26
|
+
"code": 200,
|
27
|
+
"message": "success",
|
28
|
+
"current_page": 1,
|
29
|
+
"next_page": -1,
|
30
|
+
"prev_page": -1,
|
31
|
+
"total_pages": 1,
|
32
|
+
"total_count": 1
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"id": "5b7ce9085a5e43fb0775be86",
|
4
|
+
"custom_id": "string",
|
5
|
+
"title": "string",
|
6
|
+
"status": "unprocessed",
|
7
|
+
"conversation": [
|
8
|
+
{
|
9
|
+
"name": "string",
|
10
|
+
"message": "string"
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"categories": [],
|
14
|
+
"staff_id": null,
|
15
|
+
"postback_url": "string",
|
16
|
+
"postback_method": "string",
|
17
|
+
"project_id": 159,
|
18
|
+
"processed_at": null,
|
19
|
+
"allow_empty": false,
|
20
|
+
"created_at": "2018-08-22T11:39:36.885+07:00",
|
21
|
+
"qa_status": null
|
22
|
+
},
|
23
|
+
"meta": {
|
24
|
+
"code": 200,
|
25
|
+
"message": "success"
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"data": [
|
3
|
+
{
|
4
|
+
"id": "5b7ce84b5a5e43fb0775be85",
|
5
|
+
"custom_id": null,
|
6
|
+
"status": "unprocessed",
|
7
|
+
"data": "test",
|
8
|
+
"answer": "",
|
9
|
+
"staff_id": null,
|
10
|
+
"postback_url": null,
|
11
|
+
"postback_method": "GET",
|
12
|
+
"project_id": 157,
|
13
|
+
"processed_at": null,
|
14
|
+
"created_at": "2018-08-22T11:36:27.634+07:00",
|
15
|
+
"qa_status": null
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"meta": {
|
19
|
+
"code": 200,
|
20
|
+
"message": "success",
|
21
|
+
"current_page": 1,
|
22
|
+
"next_page": -1,
|
23
|
+
"prev_page": -1,
|
24
|
+
"total_pages": 1,
|
25
|
+
"total_count": 2
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"id": "5b7ce84b5a5e43fb0775be85",
|
4
|
+
"custom_id": null,
|
5
|
+
"status": "unprocessed",
|
6
|
+
"data": "test",
|
7
|
+
"answer": "",
|
8
|
+
"staff_id": null,
|
9
|
+
"postback_url": null,
|
10
|
+
"postback_method": "GET",
|
11
|
+
"project_id": 157,
|
12
|
+
"processed_at": null,
|
13
|
+
"created_at": "2018-08-22T11:36:27.634+07:00",
|
14
|
+
"qa_status": null
|
15
|
+
},
|
16
|
+
"meta": {
|
17
|
+
"code": 200,
|
18
|
+
"message": "success"
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"data": [
|
3
|
+
{
|
4
|
+
"id": "5b7ce97d5a5e43fb0775be87",
|
5
|
+
"answers": [
|
6
|
+
""
|
7
|
+
],
|
8
|
+
"custom_id": null,
|
9
|
+
"custom_conversation_ids": [
|
10
|
+
"1"
|
11
|
+
],
|
12
|
+
"status": "unprocessed",
|
13
|
+
"conversation": [
|
14
|
+
"test"
|
15
|
+
],
|
16
|
+
"staff_id": null,
|
17
|
+
"postback_url": null,
|
18
|
+
"postback_method": "GET",
|
19
|
+
"project_id": 160,
|
20
|
+
"created_at": "2018-08-22T11:41:33.572+07:00",
|
21
|
+
"processed_at": null
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"meta": {
|
25
|
+
"code": 200,
|
26
|
+
"message": "success",
|
27
|
+
"current_page": 1,
|
28
|
+
"next_page": -1,
|
29
|
+
"prev_page": -1,
|
30
|
+
"total_pages": 1,
|
31
|
+
"total_count": 1
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"id": "5b7ce97d5a5e43fb0775be87",
|
4
|
+
"answers": [
|
5
|
+
""
|
6
|
+
],
|
7
|
+
"custom_id": null,
|
8
|
+
"custom_conversation_ids": [
|
9
|
+
"1"
|
10
|
+
],
|
11
|
+
"status": "unprocessed",
|
12
|
+
"conversation": [
|
13
|
+
"test"
|
14
|
+
],
|
15
|
+
"staff_id": null,
|
16
|
+
"postback_url": null,
|
17
|
+
"postback_method": "GET",
|
18
|
+
"project_id": 160,
|
19
|
+
"created_at": "2018-08-22T11:41:33.572+07:00",
|
20
|
+
"processed_at": null
|
21
|
+
},
|
22
|
+
"meta": {
|
23
|
+
"code": 200,
|
24
|
+
"message": "success"
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"video": [
|
4
|
+
{
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
6
|
+
"answer": "declined",
|
7
|
+
"credit_charged": 1,
|
8
|
+
"custom_id": null,
|
9
|
+
"data": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
|
10
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
11
|
+
"processed_at": "2017-12-28T10:40:30.462+07:00",
|
12
|
+
"project_id": 102,
|
13
|
+
"status": "processed"
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"meta": {
|
18
|
+
"code": 200,
|
19
|
+
"message": "success"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"video": {
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
5
|
+
"answer": "declined",
|
6
|
+
"credit_charged": 1,
|
7
|
+
"custom_id": null,
|
8
|
+
"data": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
|
9
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
10
|
+
"processed_at": "2017-12-28T10:40:30.462+07:00",
|
11
|
+
"project_id": 102,
|
12
|
+
"status": "processed"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"meta": {
|
16
|
+
"code": 200,
|
17
|
+
"message": "success"
|
18
|
+
}
|
19
|
+
}
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
2
|
+
require 'simplecov'
|
3
|
+
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require 'helper/file_reader'
|
7
|
+
require 'datawow'
|
8
|
+
require 'minitest/autorun'
|
9
|
+
require 'webmock/minitest'
|
10
|
+
|
11
|
+
class TestBase < Minitest::Test
|
12
|
+
attr_reader :options, :image_choice, :image_choices, :image_closed_question,
|
13
|
+
:image_closed_questions, :image_message, :image_messages, :image_photo_tag,
|
14
|
+
:image_photo_tags, :prediction, :predictions, :videos, :video,
|
15
|
+
:text_categories, :text_category, :text_conversations, :text_conversation,
|
16
|
+
:text_closed_questions, :text_closed_question, :nanameue_human, :nanameue_humans
|
17
|
+
|
18
|
+
IMAGE_CHOICES_URL = 'https://kiyo-image.datawow.io/api/v1/images/choices'.freeze
|
19
|
+
IMAGE_CHOICE_URL = 'https://kiyo-image.datawow.io/api/v1/images/choice'.freeze
|
20
|
+
IMAGE_CLOSED_QUESTIONS_URL = 'https://kiyo-image.datawow.io/api/v1/images/closed_questions'.freeze
|
21
|
+
IMAGE_CLOSED_QUESTION_URL = 'https://kiyo-image.datawow.io/api/v1/images/closed_question'.freeze
|
22
|
+
IMAGE_MESSAGES_URL = 'https://kiyo-image.datawow.io/api/v1/images/messages'.freeze
|
23
|
+
IMAGE_MESSAGE_URL = 'https://kiyo-image.datawow.io/api/v1/images/message'.freeze
|
24
|
+
IMAGE_PHOTO_TAGS = 'https://kiyo-image.datawow.io/api/v1/images/photo_tags'.freeze
|
25
|
+
IMAGE_PHOTO_TAG = 'https://kiyo-image.datawow.io/api/v1/images/photo_tag'.freeze
|
26
|
+
PREDICTIONS_URL = 'https://kiyo-image.datawow.io/api/v1/prime/predictions'.freeze
|
27
|
+
IMAGE_URL = 'https://kiyo-image.datawow.io/api/v1/projects/images'.freeze
|
28
|
+
VIDEO_URL = 'https://kiyo-image.datawow.io/api/v1/videos/closed_questions'.freeze
|
29
|
+
NANAMEUE_HUMAN_URL = 'https://kiyo-image.datawow.io/api/v1/jobs/nanameue/consensuses'.freeze
|
30
|
+
TEXT_CATEGORY_URL = 'https://kiyo-text.datawow.io/api/v1/text/text_categories'.freeze
|
31
|
+
TEXT_CONVERSATION_URL = 'https://kiyo-text.datawow.io/api/v1/text/text_conversations'.freeze
|
32
|
+
TEXT_CLOSED_QUESTION_URL = 'https://kiyo-text.datawow.io/api/v1/text/text_closed_questions'.freeze
|
33
|
+
|
34
|
+
def setup
|
35
|
+
@image_choices = FileReader.new('test/fixtures/image_choice/all.json').read_json
|
36
|
+
@image_choice = FileReader.new('test/fixtures/image_choice/create.json').read_json
|
37
|
+
@image_closed_questions = FileReader.new('test/fixtures/image_closed_question/all.json').read_json
|
38
|
+
@image_closed_question = FileReader.new('test/fixtures/image_closed_question/create.json').read_json
|
39
|
+
@image_messages = FileReader.new('test/fixtures/image_message/all.json').read_json
|
40
|
+
@image_message = FileReader.new('test/fixtures/image_message/create.json').read_json
|
41
|
+
@image_photo_tags = FileReader.new('test/fixtures/image_photo_tag/all.json').read_json
|
42
|
+
@image_photo_tag = FileReader.new('test/fixtures/image_photo_tag/create.json').read_json
|
43
|
+
@predictions = FileReader.new('test/fixtures/prediction/all.json').read_json
|
44
|
+
@prediction = FileReader.new('test/fixtures/prediction/create.json').read_json
|
45
|
+
@videos = FileReader.new('test/fixtures/video_classification/all.json').read_json
|
46
|
+
@video = FileReader.new('test/fixtures/video_classification/create.json').read_json
|
47
|
+
@nanameue_human = FileReader.new('test/fixtures/nanameue_human/create.json').read_json
|
48
|
+
@nanameue_humans = FileReader.new('test/fixtures/nanameue_human/all.json').read_json
|
49
|
+
@text_category = FileReader.new('test/fixtures/text_category/create.json').read_json
|
50
|
+
@text_categories = FileReader.new('test/fixtures/text_category/all.json').read_json
|
51
|
+
@text_conversation = FileReader.new('test/fixtures/text_conversation/create.json').read_json
|
52
|
+
@text_conversations = FileReader.new('test/fixtures/text_conversation/all.json').read_json
|
53
|
+
@text_closed_question = FileReader.new('test/fixtures/text_closed_question/create.json').read_json
|
54
|
+
@text_closed_questions = FileReader.new('test/fixtures/text_closed_question/all.json').read_json
|
55
|
+
@options = {
|
56
|
+
token: 'project token'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
end
|