@@ -40,28 +40,9 @@ def test_create_batch(configured_project: Project, big_dataset: Dataset):
40
40
assert batch .size == len (data_rows )
41
41
42
42
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
-
63
43
def test_archive_batch (configured_project : Project , small_dataset : Dataset ):
64
44
data_rows = [dr .uid for dr in list (small_dataset .export_data_rows ())]
45
+ configured_project .update (queue_mode = Project .QueueMode .Batch )
65
46
batch = configured_project .create_batch ("batch to archive" , data_rows )
66
47
batch .remove_queued_data_rows ()
67
48
exported_data_rows = list (batch .export_data_rows ())
@@ -71,9 +52,31 @@ def test_archive_batch(configured_project: Project, small_dataset: Dataset):
71
52
72
53
def test_batch_project (configured_project : Project , small_dataset : Dataset ):
73
54
data_rows = [dr .uid for dr in list (small_dataset .export_data_rows ())]
55
+ configured_project .update (queue_mode = Project .QueueMode .Batch )
74
56
batch = configured_project .create_batch (
75
57
"batch to test project relationship" , data_rows )
76
58
project_from_batch = batch .project ()
77
59
78
60
assert project_from_batch .uid == configured_project .uid
79
61
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