Skip to content

Commit

Permalink
Test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RhetTbull committed Sep 15, 2024
1 parent b990647 commit c70aca1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_catalina_10_15_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import tempfile
import time
from collections import Counter, namedtuple
from unittest import mock
from zoneinfo import ZoneInfo

import pytest

Expand Down Expand Up @@ -703,9 +705,15 @@ def test_photoinfo_intrash_1(photosdb):

p = photosdb.photos(uuid=[UUID_DICT["intrash"]], intrash=True)[0]
assert p.intrash
assert dt_to_local(p.date_trashed) == dt_to_local(
datetime.datetime.fromisoformat("2120-06-10T11:24:47.685857-05:00")
)
mock_local_timezone = ZoneInfo("America/Chicago")
with mock.patch("datetime.datetime", wraps=datetime.datetime) as mock_datetime:
mock_datetime.now.return_value = datetime.datetime(
2120, 6, 10, 11, 24, 47, 685857, tzinfo=mock_local_timezone
)
expected = datetime.datetime(
2120, 6, 10, 11, 24, 47, 685857, tzinfo=mock_local_timezone
)
assert p.date_trashed == expected


def test_photoinfo_intrash_2(photosdb):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_export_catalina_10_15_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ def test_exiftool_json_sidecar(photosdb):
json_got = json.loads(json_got)[0]

for k, v in json_got.items():
if k in {"EXIF:ModifyDate", "EXIF:OffsetTime"}:
continue
assert v == json_expected.get(k)


Expand Down

0 comments on commit c70aca1

Please sign in to comment.