Skip to content

Commit 71d946e

Browse files
committed
adding test case to cover filtered exports
1 parent 4a1a668 commit 71d946e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/integration/test_export.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from turtle import st
12
import uuid
3+
4+
from numpy import empty
25
from labelbox.data.annotation_types.annotation import ObjectAnnotation
36

47
from labelbox.schema.annotation_import import LabelImport
@@ -55,3 +58,42 @@ def test_export_annotations_nested_checklist(
5558

5659
nested_class_answers = object_annotation.classifications[0].value.answer
5760
assert len(nested_class_answers) == 2
61+
62+
63+
def test_export_filtered_dates(client,
64+
configured_project_with_complex_ontology):
65+
project, data_row = configured_project_with_complex_ontology
66+
ontology = project.ontology().normalized
67+
68+
tool = ontology["tools"][0]
69+
70+
data = [{
71+
"uuid": str(uuid.uuid4()),
72+
"schemaId": tool['featureSchemaId'],
73+
"dataRow": {
74+
"id": data_row.uid
75+
},
76+
"bbox": {
77+
"top": 20,
78+
"left": 20,
79+
"height": 50,
80+
"width": 50
81+
}
82+
}]
83+
84+
task = LabelImport.create_from_objects(client, project.uid,
85+
f'label-import-{uuid.uuid4()}', data)
86+
task.wait_until_done()
87+
88+
regular_export = project.export_labels(download=True)
89+
assert len(regular_export) == 1
90+
91+
filtered_export = project.export_labels(download=True, start="2020-01-01")
92+
assert len(filtered_export) == 1
93+
94+
empty_export = project.export_labels(download=True,
95+
start="2020-01-01",
96+
end="2020-01-02")
97+
assert len(empty_export) == 0
98+
99+
# new_export = project.export_labels(start)

0 commit comments

Comments
 (0)