Skip to content

Commit 896f96b

Browse files
committed
fix to test cases
1 parent b11bc13 commit 896f96b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

tests/data/serialization/labelbox_v1/test_text.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_text():
1010
serialized = next(LBV1Converter.serialize(collection))
1111

1212
payload['media_type'] = 'text'
13+
payload['Global Key'] = None
1314

1415
assert serialized.keys() == payload.keys()
1516
for key in serialized:
@@ -18,6 +19,8 @@ def test_text():
1819
elif key == 'Label':
1920
for annotation_a, annotation_b in zip(serialized[key]['objects'],
2021
payload[key]['objects']):
22+
annotation_b['page'] = None
23+
annotation_b['unit'] = None
2124
if not len(annotation_a['classifications']):
2225
# We don't add a classification key to the payload if there is no classifications.
2326
annotation_a.pop('classifications')

tests/data/serialization/labelbox_v1/test_unknown_media.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_image():
1616

1717
for row in payload:
1818
row['media_type'] = 'image'
19+
row['Global Key'] = None
1920

2021
collection = LBV1Converter.deserialize(payload)
2122
for idx, serialized in enumerate(LBV1Converter.serialize(collection)):
@@ -30,6 +31,8 @@ def test_image():
3031
if not len(annotation_a['classifications']):
3132
# We don't add a classification key to the payload if there is no classifications.
3233
annotation_a.pop('classifications')
34+
annotation_b['page'] = None
35+
annotation_b['unit'] = None
3336

3437
if isinstance(annotation_b.get('classifications'),
3538
list) and len(

tests/data/serialization/labelbox_v1/test_video.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def test_video():
1818
collection = LBV1Converter.deserialize([payload])
1919
serialized = next(LBV1Converter.serialize(collection))
2020
payload['media_type'] = 'video'
21+
payload['Global Key'] = None
2122
assert serialized.keys() == payload.keys()
2223
for key in serialized:
2324
if key != 'Label':
@@ -32,6 +33,8 @@ def test_video():
3233

3334
for obj_a, obj_b in zip(annotation_a['objects'],
3435
annotation_b['objects']):
36+
obj_b['page'] = None
37+
obj_b['unit'] = None
3538
obj_a = round_dict(obj_a)
3639
obj_b = round_dict(obj_b)
3740
assert obj_a == obj_b

0 commit comments

Comments
 (0)