1
1
from datetime import datetime , timedelta
2
+ from labelbox .exceptions import ResourceNotFoundError
2
3
from labelbox .schema .labeling_service import LabelingServiceStatus
3
4
from labelbox .schema .ontology_kind import EditorTaskType
4
5
from labelbox .schema .media_type import MediaType
5
6
from labelbox .schema .search_filters import IntegerValue , RangeOperatorWithSingleValue , DateRange , RangeOperatorWithValue , DateRangeValue , DateValue , IdOperator , OperationType , OrganizationFilter , TaskCompletedCountFilter , WorkforceRequestedDateFilter , WorkforceRequestedDateRangeFilter , WorkspaceFilter , TaskRemainingCountFilter
7
+ import pytest
6
8
7
9
8
- def test_request_labeling_service_dashboard (rand_gen ,
9
- offline_chat_evaluation_project ,
10
- chat_evaluation_ontology ,
11
- offline_conversational_data_row ):
12
- project = offline_chat_evaluation_project
13
- project .connect_ontology (chat_evaluation_ontology )
10
+ def test_request_labeling_service_dashboard (requested_labeling_service ):
11
+ project , _ = requested_labeling_service
14
12
15
- project .create_batch (
16
- rand_gen (str ),
17
- [offline_conversational_data_row .uid ], # sample of data row objects
18
- )
19
13
labeling_service_dashboard = project .labeling_service_dashboard ()
20
14
assert labeling_service_dashboard .status == LabelingServiceStatus .Missing
21
15
assert labeling_service_dashboard .tasks_completed == 0
@@ -32,6 +26,17 @@ def test_request_labeling_service_dashboard(rand_gen,
32
26
assert labeling_service_dashboard .tasks_remaining == 0
33
27
34
28
29
+ def test_request_labeling_service_dashboard_not_started (
30
+ offline_chat_evaluation_project ):
31
+ project = offline_chat_evaluation_project
32
+
33
+ with pytest .raises (ResourceNotFoundError ) as e :
34
+ project .labeling_service_dashboard ()
35
+
36
+ with pytest .raises (ResourceNotFoundError ) as e :
37
+ [ld for ld in project .client .get_labeling_service_dashboards ()][0 ]
38
+
39
+
35
40
def test_request_labeling_service_dashboard_filters (requested_labeling_service ):
36
41
project , _ = requested_labeling_service
37
42
0 commit comments