Skip to content

Commit 40168a4

Browse files
author
Adrian Chang
committed
Add integration test for buffered
1 parent 4ccf197 commit 40168a4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

libs/labelbox/tests/data/export/streamable/test_export_data_rows_streamable.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,25 @@ def test_with_data_row_object(self, client, data_row,
2727
assert export_task.get_total_lines(stream_type=StreamType.RESULT) == 1
2828
assert (json.loads(list(export_task.get_stream())[0].json_str)
2929
["data_row"]["id"] == data_row.uid)
30+
31+
def test_with_data_row_object_buffered(self, client, data_row,
32+
wait_for_data_row_processing):
33+
data_row = wait_for_data_row_processing(client, data_row)
34+
time.sleep(7) # temp fix for ES indexing delay
35+
export_task = DataRow.export(
36+
client=client,
37+
data_rows=[data_row],
38+
task_name="TestExportDataRow:test_with_data_row_object_buffered",
39+
)
40+
export_task.wait_till_done()
41+
assert export_task.status == "COMPLETE"
42+
assert isinstance(export_task, ExportTask)
43+
assert export_task.has_result()
44+
assert export_task.has_errors() is False
45+
assert export_task.get_total_file_size(
46+
stream_type=StreamType.RESULT) > 0
47+
assert export_task.get_total_lines(stream_type=StreamType.RESULT) == 1
48+
assert list(export_task.get_buffered_stream())[0].json["data_row"]["id"] == data_row.uid
3049

3150
def test_with_id(self, client, data_row, wait_for_data_row_processing):
3251
data_row = wait_for_data_row_processing(client, data_row)

0 commit comments

Comments
 (0)