Skip to content

Commit

Permalink
fix tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpt committed Feb 5, 2025
1 parent 1cb47d1 commit c15a016
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
15 changes: 8 additions & 7 deletions tests/integration/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ def run_exiftool_and_generate_geotag_args(
def validate_and_extract_image(image_path: str):
with open(image_path, "rb") as fp:
tags = exifread.process_file(fp)
desc_tag = tags.get("Image ImageDescription")
assert desc_tag is not None, (tags, image_path)
desc = json.loads(str(desc_tag.values))
desc["filename"] = image_path
desc["filetype"] = "image"
jsonschema.validate(desc, image_description_schema)
return desc

desc_tag = tags.get("Image ImageDescription")
assert desc_tag is not None, (tags, image_path)
desc = json.loads(str(desc_tag.values))
desc["filename"] = image_path
desc["filetype"] = "image"
jsonschema.validate(desc, image_description_schema)
return desc


def validate_and_extract_zip(zip_path: str) -> T.List[T.Dict]:
Expand Down
9 changes: 2 additions & 7 deletions tests/integration/test_process_and_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"MAPLatitude": 33.1266719,
"MAPLongitude": -117.3273063,
"MAPOrientation": 1,
"filesize": 116432,
"filetype": "image",
},
"mly_tools_724084a74a44eebd025d0d97a1d5aa30_NA_000002.jpg": {
Expand All @@ -80,7 +79,6 @@
"MAPLatitude": 33.1266891,
"MAPLongitude": -117.3273151,
"MAPOrientation": 1,
"filesize": 125847,
"filetype": "image",
},
"mly_tools_724084a74a44eebd025d0d97a1d5aa30_NA_000003.jpg": {
Expand All @@ -92,7 +90,6 @@
"MAPLatitude": 33.1267078,
"MAPLongitude": -117.3273264,
"MAPOrientation": 1,
"filesize": 128344,
"filetype": "image",
},
"mly_tools_724084a74a44eebd025d0d97a1d5aa30_NA_000004.jpg": {
Expand All @@ -104,7 +101,6 @@
"MAPLatitude": 33.1267282,
"MAPLongitude": -117.3273391,
"MAPOrientation": 1,
"filesize": 126391,
"filetype": "image",
},
"mly_tools_724084a74a44eebd025d0d97a1d5aa30_NA_000005.jpg": {
Expand All @@ -116,7 +112,6 @@
"MAPLatitude": 33.12675,
"MAPLongitude": -117.3273483,
"MAPOrientation": 1,
"filesize": 128585,
"filetype": "image",
},
"mly_tools_724084a74a44eebd025d0d97a1d5aa30_NA_000006.jpg": {
Expand All @@ -128,7 +123,6 @@
"MAPLatitude": 33.1267663,
"MAPLongitude": -117.3273595,
"MAPOrientation": 1,
"filesize": 132640,
"filetype": "image",
},
},
Expand All @@ -149,7 +143,8 @@ def _validate_output(upload_dir: py.path.local, expected):
actual[os.path.basename(desc["filename"])] = {
k: v
for k, v in desc.items()
if k not in ["filename", "md5sum", "MAPMetaTags", "MAPSequenceUUID"]
if k
not in ["filename", "filesize", "md5sum", "MAPMetaTags", "MAPSequenceUUID"]
}

assert expected == actual
Expand Down

0 comments on commit c15a016

Please sign in to comment.