1
1
import pytest
2
+ from unittest .mock import patch
3
+
2
4
from labelbox import MediaType
3
5
from labelbox .schema .ontology_kind import OntologyKind
4
6
from labelbox .exceptions import MalformedQueryException
5
7
6
8
7
9
def test_create_chat_evaluation_ontology_project (
8
10
client , chat_evaluation_ontology ,
9
- live_chat_evaluation_project_with_new_dataset , conversation_data_row ,
10
- rand_gen ):
11
+ live_chat_evaluation_project_with_new_dataset ,
12
+ offline_conversational_data_row , rand_gen ):
11
13
ontology = chat_evaluation_ontology
12
14
13
15
# here we are essentially testing the ontology creation which is a fixture
@@ -31,12 +33,23 @@ def test_create_chat_evaluation_ontology_project(
31
33
assert project .labeling_frontend ().name == "Editor"
32
34
assert project .ontology ().name == ontology .name
33
35
36
+ # with pytest.raises(MalformedQueryException,
37
+ # match="No valid data rows to add to project"):
38
+ # project.create_batch(
39
+ # rand_gen(str),
40
+ # [offline_conversational_data_row.uid], # sample of data row objects
41
+ # )
42
+
34
43
with pytest .raises (MalformedQueryException ,
35
44
match = "No valid data rows to add to project" ):
36
- project .create_batch (
37
- rand_gen (str ),
38
- [conversation_data_row .uid ], # sample of data row objects
39
- )
45
+ with patch ('labelbox.schema.project.MAX_SYNC_BATCH_ROW_COUNT' ,
46
+ new = 0 ): # force to async
47
+
48
+ project .create_batch (
49
+ rand_gen (str ),
50
+ [offline_conversational_data_row .uid
51
+ ], # sample of data row objects
52
+ )
40
53
41
54
42
55
def test_create_chat_evaluation_ontology_project_existing_dataset (
0 commit comments