Skip to content

Commit ad9c94d

Browse files
mrobers1982claude
andcommitted
[PLT-0] Fix test expectations for updated test assets
Follow-up to the test-asset repath (#2055). The new hosted assets differ from the deleted originals, so several tests need their fixtures/expected values realigned: - image_url: point at a stable, byte-stable JPEG (potato.jpeg) instead of picsum.photos, which returns a random image per request and broke every byte-equality assertion in test_data_rows.py. This also restores test_multiple_chunks (the shorter picsum URL under-filled the mocked 300-byte upsert chunks, yielding 7 upload calls instead of 11). - Same picsum -> stable JPEG swap in the alignerr conftest (latent; no byte-equality asserts there, but removes the third-party dependency). - Text TextEntity token updated to match sample-text.txt at offsets 112-128. - Document entity token IDs/groupId/text and page width (594) updated to match sample-pdf-textlayer.json / test-pdf.pdf. - Video frame_rate/frame_count updated to test_video_500kb.mp4 (25 fps, 627). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 07d76aa commit ad9c94d

4 files changed

Lines changed: 34 additions & 27 deletions

File tree

libs/labelbox/tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
from labelbox.schema.project import Project
3434
from labelbox.schema.quality_mode import QualityMode
3535

36-
IMG_URL = "https://picsum.photos/200/300.jpg"
36+
# Must be a stable, deterministic JPEG: several tests assert byte-equality
37+
# between the source and the server-rehosted copy, so a random image service
38+
# (e.g. picsum.photos) or a format the server may transcode (e.g. PNG) breaks them.
39+
IMG_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
3740
SMALL_DATASET_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
3841
DATA_ROW_PROCESSING_WAIT_TIMEOUT_SECONDS = 30
3942
DATA_ROW_PROCESSING_WAIT_SLEEP_INTERNAL_SECONDS = 3

libs/labelbox/tests/data/annotation_import/conftest.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,16 +1280,17 @@ def entity_inference_document(prediction_id_mapping):
12801280
"textSelections": [
12811281
{
12821282
"tokenIds": [
1283-
"3f984bf3-1d61-44f5-b59a-9658a2e3440f",
1284-
"3bf00b56-ff12-4e52-8cc1-08dbddb3c3b8",
1285-
"6e1c3420-d4b7-4c5a-8fd6-ead43bf73d80",
1286-
"87a43d32-af76-4a1d-b262-5c5f4d5ace3a",
1287-
"e8606e8a-dfd9-4c49-a635-ad5c879c75d0",
1288-
"67c7c19e-4654-425d-bf17-2adb8cf02c30",
1289-
"149c5e80-3e07-49a7-ab2d-29ddfe6a38fa",
1290-
"b0e94071-2187-461e-8e76-96c58738a52c",
1283+
"543ea587-6817-4d2b-a9c1-6d8dd797e8d7",
1284+
"f4c15744-c9fe-48f2-89dc-8f52fafda028",
1285+
"43867d16-0236-47cd-b348-5190143a3ccb",
1286+
"521f705e-b276-4ac7-8e5b-2e38e037f80f",
1287+
"4c1475f9-3576-4171-91a9-7cfb369c73d8",
1288+
"a75658b1-dd91-4f9f-b7d8-572eee7fd707",
1289+
"480a3484-28d9-4690-a466-0b8e24a24c3a",
1290+
"d8fcd3cb-4bf7-461c-a91f-f9142b6bc3c3",
1291+
"4ec0bac5-e5d7-4eda-802b-3962ad2db82c",
12911292
],
1292-
"groupId": "2f4336f4-a07e-4e0a-a9e1-5629b03b719b",
1293+
"groupId": "ed53dd86-ef39-4634-9505-ee0eebedef44",
12931294
"page": 1,
12941295
}
12951296
]
@@ -2155,7 +2156,7 @@ def expected_export_v2_text():
21552156
"location": {
21562157
"start": 112,
21572158
"end": 128,
2158-
"token": "research suggests",
2159+
"token": " sollicitudin nis",
21592160
},
21602161
}
21612162
],
@@ -2350,19 +2351,20 @@ def expected_export_v2_document():
23502351
"location": {
23512352
"groups": [
23522353
{
2353-
"id": "2f4336f4-a07e-4e0a-a9e1-5629b03b719b",
2354+
"id": "ed53dd86-ef39-4634-9505-ee0eebedef44",
23542355
"page_number": 1,
23552356
"tokens": [
2356-
"3f984bf3-1d61-44f5-b59a-9658a2e3440f",
2357-
"3bf00b56-ff12-4e52-8cc1-08dbddb3c3b8",
2358-
"6e1c3420-d4b7-4c5a-8fd6-ead43bf73d80",
2359-
"87a43d32-af76-4a1d-b262-5c5f4d5ace3a",
2360-
"e8606e8a-dfd9-4c49-a635-ad5c879c75d0",
2361-
"67c7c19e-4654-425d-bf17-2adb8cf02c30",
2362-
"149c5e80-3e07-49a7-ab2d-29ddfe6a38fa",
2363-
"b0e94071-2187-461e-8e76-96c58738a52c",
2357+
"543ea587-6817-4d2b-a9c1-6d8dd797e8d7",
2358+
"f4c15744-c9fe-48f2-89dc-8f52fafda028",
2359+
"43867d16-0236-47cd-b348-5190143a3ccb",
2360+
"521f705e-b276-4ac7-8e5b-2e38e037f80f",
2361+
"4c1475f9-3576-4171-91a9-7cfb369c73d8",
2362+
"a75658b1-dd91-4f9f-b7d8-572eee7fd707",
2363+
"480a3484-28d9-4690-a466-0b8e24a24c3a",
2364+
"d8fcd3cb-4bf7-461c-a91f-f9142b6bc3c3",
2365+
"4ec0bac5-e5d7-4eda-802b-3962ad2db82c",
23642366
],
2365-
"text": "Metal-insulator (MI) transitions have been one of the",
2367+
"text": "Mott transition and superconductivity in the strongly correlated organic",
23662368
}
23672369
]
23682370
},
@@ -2382,7 +2384,7 @@ def expected_export_v2_document():
23822384
},
23832385
"page_dimensions": {
23842386
"height": 792.0,
2385-
"width": 612.0,
2387+
"width": 594.0,
23862388
"unit": "points",
23872389
},
23882390
},

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ def test_export(
7676
assert data_row_export["row_data"] == video_data_row["row_data"]
7777
assert export_data["media_attributes"]["mime_type"] == "video/mp4"
7878
assert (
79-
export_data["media_attributes"]["frame_rate"] == 10
80-
) # as per the video_data fixture
79+
export_data["media_attributes"]["frame_rate"] == 25
80+
) # intrinsic to test_video_500kb.mp4
8181
assert (
82-
export_data["media_attributes"]["frame_count"] == 100
83-
) # as per the video_data fixture
82+
export_data["media_attributes"]["frame_count"] == 627
83+
) # intrinsic to test_video_500kb.mp4 (25 fps x 25.08s)
8484
expected_export_label = {
8585
"label_kind": "Video",
8686
"version": "1.0.0",

libs/lbox-alignerr/tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
from labelbox.schema.project import Project
3434
from labelbox.schema.quality_mode import QualityMode
3535

36-
IMG_URL = "https://picsum.photos/200/300.jpg"
36+
# Use a stable, GCS-hosted JPEG rather than a random third-party image service
37+
# so data-row creation does not depend on picsum.photos availability.
38+
IMG_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
3739
SMALL_DATASET_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
3840
DATA_ROW_PROCESSING_WAIT_TIMEOUT_SECONDS = 30
3941
DATA_ROW_PROCESSING_WAIT_SLEEP_INTERNAL_SECONDS = 3

0 commit comments

Comments
 (0)