File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
tests/data/annotation_types/data Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -463,12 +463,14 @@ def dequeue(self, data_row_ids: List[str]):
463463
464464 def _post_batch (self , method , data_row_ids : List [str ]):
465465 """Post batch methods"""
466-
466+
467467 if self .queue_mode () != QueueMode .Batch :
468468 raise ValueError ("Project must be in batch mode" )
469469
470470 if len (data_row_ids ) > MAX_QUEUE_BATCH_SIZE :
471- raise ValueError (f"Batch exceeds max size of { MAX_QUEUE_BATCH_SIZE } , consider breaking it into parts" )
471+ raise ValueError (
472+ f"Batch exceeds max size of { MAX_QUEUE_BATCH_SIZE } , consider breaking it into parts"
473+ )
472474
473475 query = """mutation %sPyApi($projectId: ID!, $dataRowIds: [ID!]!) {
474476 project(where: {id: $projectId}) {
Original file line number Diff line number Diff line change 1+ import os
2+
13import pytest
24from pydantic import ValidationError
35
@@ -22,11 +24,13 @@ def test_url():
2224 assert len (text ) == 3541
2325
2426
25- def test_file ():
26- file_path = "tests/data/assets/sample_text.txt"
27- text_data = TextData (file_path = file_path )
28- text = text_data .value
29- assert len (text ) == 3541
27+ def test_file (tmpdir ):
28+ content = "foo bar baz"
29+ file = "hello.txt"
30+ dir = tmpdir .mkdir ('data' )
31+ dir .join (file ).write (content )
32+ text_data = TextData (file_path = os .path .join (dir .strpath , file ))
33+ assert len (text_data .value ) == len (content )
3034
3135
3236def test_ref ():
You can’t perform that action at this time.
0 commit comments