Skip to content

Commit ae9012d

Browse files
author
Val Brodsky
committed
Test improvements
1 parent e19673d commit ae9012d

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

libs/labelbox/tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,9 @@ def valid_model_id():
10991099

11001100

11011101
@pytest.fixture
1102-
def requested_labeling_service(
1103-
rand_gen, live_chat_evaluation_project_with_new_dataset,
1104-
chat_evaluation_ontology, model_config):
1102+
def requested_labeling_service(rand_gen,
1103+
live_chat_evaluation_project_with_new_dataset,
1104+
chat_evaluation_ontology, model_config):
11051105
project = live_chat_evaluation_project_with_new_dataset
11061106
project.connect_ontology(chat_evaluation_ontology)
11071107

@@ -1113,4 +1113,4 @@ def requested_labeling_service(
11131113

11141114
labeling_service.request()
11151115

1116-
yield project, labeling_service
1116+
yield project, project.get_labeling_service()

libs/labelbox/tests/integration/test_labeling_dashboard.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
from datetime import datetime, timedelta
2+
from labelbox.exceptions import ResourceNotFoundError
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, RangeOperatorWithSingleValue, DateRange, RangeOperatorWithValue, DateRangeValue, DateValue, IdOperator, OperationType, OrganizationFilter, TaskCompletedCountFilter, WorkforceRequestedDateFilter, WorkforceRequestedDateRangeFilter, WorkspaceFilter, TaskRemainingCountFilter
7+
import pytest
68

79

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
1412

15-
project.create_batch(
16-
rand_gen(str),
17-
[offline_conversational_data_row.uid], # sample of data row objects
18-
)
1913
labeling_service_dashboard = project.labeling_service_dashboard()
2014
assert labeling_service_dashboard.status == LabelingServiceStatus.Missing
2115
assert labeling_service_dashboard.tasks_completed == 0
@@ -32,6 +26,17 @@ def test_request_labeling_service_dashboard(rand_gen,
3226
assert labeling_service_dashboard.tasks_remaining == 0
3327

3428

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+
3540
def test_request_labeling_service_dashboard_filters(requested_labeling_service):
3641
project, _ = requested_labeling_service
3742

0 commit comments

Comments
 (0)