Cleaned up tests, fixed bug in PhotosDB.query
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
import pytest
|
||||
|
||||
import osxphotos
|
||||
|
||||
PHOTOS_DB_CLOUD = "./tests/Test-Cloud-10.14.6.photoslibrary/database/photos.db"
|
||||
PHOTOS_DB_NOT_CLOUD = "./tests/Test-10.14.6.photoslibrary/database/photos.db"
|
||||
|
||||
@@ -13,37 +15,29 @@ UUID_DICT = {
|
||||
}
|
||||
|
||||
|
||||
def test_incloud():
|
||||
import osxphotos
|
||||
@pytest.fixture(scope="module")
|
||||
def photosdb():
|
||||
return osxphotos.PhotosDB(dbfile=PHOTOS_DB_CLOUD)
|
||||
|
||||
photosdb = osxphotos.PhotosDB(PHOTOS_DB_CLOUD)
|
||||
def test_incloud(photosdb):
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["incloud"]])
|
||||
|
||||
assert photos[0].incloud
|
||||
|
||||
|
||||
def test_not_incloud():
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(PHOTOS_DB_CLOUD)
|
||||
def test_not_incloud(photosdb):
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["not_incloud"]])
|
||||
|
||||
assert not photos[0].incloud
|
||||
|
||||
|
||||
def test_cloudasset_1():
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(PHOTOS_DB_CLOUD)
|
||||
def test_cloudasset_1(photosdb):
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["cloudasset"]])
|
||||
|
||||
assert photos[0].iscloudasset
|
||||
|
||||
|
||||
def test_cloudasset_2():
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(PHOTOS_DB_CLOUD)
|
||||
def test_cloudasset_2(photosdb):
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["not_incloud"]])
|
||||
|
||||
# not_incloud is still a cloud asset
|
||||
|
||||
Reference in New Issue
Block a user