Skip to content

Commit c9909d3

Browse files
authored
Add sleep to be able to test labeling service dashboard (#1782)
1 parent 205cd72 commit c9909d3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libs/labelbox/tests/integration/test_labeling_dashboard.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
from datetime import datetime, timedelta
2+
from time import sleep
23
from labelbox.schema.labeling_service import LabelingServiceStatus
34
from labelbox.schema.ontology_kind import EditorTaskType
45
from labelbox.schema.media_type import MediaType
56
from labelbox.schema.search_filters import IntegerValue, RangeDateTimeOperatorWithSingleValue, RangeOperatorWithSingleValue, DateRange, RangeOperatorWithValue, DateRangeValue, DateValue, IdOperator, OperationType, OrganizationFilter, TaskCompletedCountFilter, WorkforceRequestedDateFilter, WorkforceRequestedDateRangeFilter, WorkspaceFilter, TaskRemainingCountFilter
67

8+
ALLOW_TIME_TO_CREATE_DASHBOARD = 5 ## seconds
9+
710

811
def test_request_labeling_service_dashboard(requested_labeling_service):
912
project, _ = requested_labeling_service
1013

1114
labeling_service_dashboard = project.get_labeling_service_dashboard()
1215
assert labeling_service_dashboard.status == LabelingServiceStatus.Requested
13-
assert labeling_service_dashboard.tasks_completed == 0
14-
assert labeling_service_dashboard.tasks_remaining == 0
16+
assert labeling_service_dashboard.tasks_completed_count == 0
17+
assert labeling_service_dashboard.tasks_remaining_count == 0
1518
assert labeling_service_dashboard.media_type == MediaType.Conversational
1619
assert labeling_service_dashboard.editor_task_type == EditorTaskType.ModelChatEvaluation
1720
assert labeling_service_dashboard.service_type == "Live chat evaluation"
1821

22+
sleep(ALLOW_TIME_TO_CREATE_DASHBOARD)
1923
labeling_service_dashboard = project.client.get_labeling_service_dashboards(
2024
).get_one()
2125
assert labeling_service_dashboard
@@ -29,6 +33,7 @@ def test_request_labeling_service_dashboard_filters(requested_labeling_service):
2933
operator=IdOperator.Is,
3034
values=[organization.uid])
3135

36+
sleep(ALLOW_TIME_TO_CREATE_DASHBOARD)
3237
labeling_service_dashboard = project.client.get_labeling_service_dashboards(
3338
search_query=[org_filter]).get_one()
3439
assert labeling_service_dashboard is not None

0 commit comments

Comments
 (0)