@@ -40,28 +40,9 @@ def test_create_batch(configured_project: Project, big_dataset: Dataset):
4040 assert batch .size == len (data_rows )
4141
4242
43- def test_export_data_rows (configured_project : Project , dataset : Dataset ):
44- n_data_rows = 5
45- task = dataset .create_data_rows ([
46- {
47- "row_data" : IMAGE_URL ,
48- "external_id" : "my-image"
49- },
50- ] * n_data_rows )
51- task .wait_till_done ()
52-
53- data_rows = [dr .uid for dr in list (dataset .export_data_rows ())]
54- batch = configured_project .create_batch ("batch test" , data_rows )
55-
56- result = list (batch .export_data_rows ())
57- exported_data_rows = [dr .uid for dr in result ]
58-
59- assert len (result ) == n_data_rows
60- assert set (data_rows ) == set (exported_data_rows )
61-
62-
6343def test_archive_batch (configured_project : Project , small_dataset : Dataset ):
6444 data_rows = [dr .uid for dr in list (small_dataset .export_data_rows ())]
45+ configured_project .update (queue_mode = Project .QueueMode .Batch )
6546 batch = configured_project .create_batch ("batch to archive" , data_rows )
6647 batch .remove_queued_data_rows ()
6748 exported_data_rows = list (batch .export_data_rows ())
@@ -71,9 +52,31 @@ def test_archive_batch(configured_project: Project, small_dataset: Dataset):
7152
7253def test_batch_project (configured_project : Project , small_dataset : Dataset ):
7354 data_rows = [dr .uid for dr in list (small_dataset .export_data_rows ())]
55+ configured_project .update (queue_mode = Project .QueueMode .Batch )
7456 batch = configured_project .create_batch (
7557 "batch to test project relationship" , data_rows )
7658 project_from_batch = batch .project ()
7759
7860 assert project_from_batch .uid == configured_project .uid
7961 assert project_from_batch .name == configured_project .name
62+
63+
64+ def test_export_data_rows (configured_project : Project , dataset : Dataset ):
65+ n_data_rows = 5
66+ task = dataset .create_data_rows ([
67+ {
68+ "row_data" : IMAGE_URL ,
69+ "external_id" : "my-image"
70+ },
71+ ] * n_data_rows )
72+ task .wait_till_done ()
73+
74+ data_rows = [dr .uid for dr in list (dataset .export_data_rows ())]
75+ configured_project .update (queue_mode = Project .QueueMode .Batch )
76+ batch = configured_project .create_batch ("batch test" , data_rows )
77+
78+ result = list (batch .export_data_rows ())
79+ exported_data_rows = [dr .uid for dr in result ]
80+
81+ assert len (result ) == n_data_rows
82+ assert set (data_rows ) == set (exported_data_rows )
0 commit comments