|
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 |
@@ -35,9 +37,20 @@ def test_create_chat_evaluation_ontology_project( |
35 | 37 | match="No valid data rows to add to project"): |
36 | 38 | project.create_batch( |
37 | 39 | rand_gen(str), |
38 | | - [conversation_data_row.uid], # sample of data row objects |
| 40 | + [offline_conversational_data_row.uid], # sample of data row objects |
39 | 41 | ) |
40 | 42 |
|
| 43 | + with pytest.raises(MalformedQueryException, |
| 44 | + match="No valid data rows to add to project"): |
| 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 | + ) |
| 53 | + |
41 | 54 |
|
42 | 55 | def test_create_chat_evaluation_ontology_project_existing_dataset( |
43 | 56 | client, chat_evaluation_ontology, |
|
0 commit comments