Added tests for PhotoInfo.__repr__
This commit is contained in:
@@ -760,7 +760,6 @@ def test_photosdb_repr():
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
print(repr(photosdb))
|
||||
photosdb2 = eval(repr(photosdb))
|
||||
|
||||
ignore_keys = ["_tmp_db", "_tmp_files"]
|
||||
@@ -768,3 +767,20 @@ def test_photosdb_repr():
|
||||
k: v for k, v in photosdb2.__dict__.items() if k not in ignore_keys
|
||||
}
|
||||
|
||||
|
||||
def test_photosinfo_repr():
|
||||
import osxphotos
|
||||
import datetime
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["favorite"]])
|
||||
photo = photos[0]
|
||||
photo2 = eval(repr(photo))
|
||||
|
||||
assert {
|
||||
k: str(v).encode("utf-8")
|
||||
for k, v in photo.__dict__.items()
|
||||
} == {
|
||||
k: str(v).encode("utf-8")
|
||||
for k, v in photo2.__dict__.items()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user