Moved AppleScript to photoscript
This commit is contained in:
@@ -11,9 +11,9 @@ pytestmark = pytest.mark.skipif(
|
||||
PHOTOS_DB = "/Users/rhet/Pictures/Photos Library.photoslibrary"
|
||||
|
||||
UUID_DICT = {
|
||||
"has_adjustments": "A8111956-E900-4DEC-9191-A04A87C07BC5",
|
||||
"no_adjustments": "EA7BB55F-92F1-4818-94E3-E8DEDC6B2E31",
|
||||
"live": "9032C168-9319-40C0-8210-5ADC42F4C603",
|
||||
"has_adjustments": "2B2D5434-6D31-49E2-BF47-B973D34A317B",
|
||||
"no_adjustments": "A8D646C3-89A9-4D74-8001-4EB46BA55B94",
|
||||
"live": "BFF29EBD-22DF-4FCF-9817-317E7104EA50",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ NAMES_DICT = {
|
||||
"heic": "7783E8E6-9CAC-40F3-BE22-81FB7051C266.jpeg",
|
||||
}
|
||||
|
||||
UUID_LIVE_HEIC = "1337F3F6-5C9F-4FC7-80CC-BD9A5B928F72"
|
||||
UUID_LIVE_HEIC = "612CE30B-3D8F-417A-9B14-EC42CBA10ACC"
|
||||
NAMES_LIVE_HEIC = [
|
||||
"1337F3F6-5C9F-4FC7-80CC-BD9A5B928F72.jpeg",
|
||||
"1337F3F6-5C9F-4FC7-80CC-BD9A5B928F72.mov",
|
||||
"612CE30B-3D8F-417A-9B14-EC42CBA10ACC.jpeg",
|
||||
"612CE30B-3D8F-417A-9B14-EC42CBA10ACC.mov",
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
""" Test PhotosDB._link_db_file """
|
||||
|
||||
import pytest
|
||||
|
||||
from tempdiskimage import TempDiskImage
|
||||
|
||||
PHOTOS_DB = "tests/Test-Movie-5_0.photoslibrary"
|
||||
|
||||
def test_link_db(capsys):
|
||||
""" Test that database doesn't get copied when opened """
|
||||
import osxphotos
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB, verbose=print)
|
||||
captured = capsys.readouterr()
|
||||
assert "creating temporary copy" not in captured.out
|
||||
|
||||
def test_copy_db(capsys):
|
||||
""" Test that database does get copied if on different filesystem """
|
||||
import pathlib
|
||||
import tempfile
|
||||
import osxphotos
|
||||
|
||||
from osxphotos.fileutil import FileUtil
|
||||
|
||||
with TempDiskImage(prefix="osxphotos") as tmpimg:
|
||||
newdb = pathlib.Path(tmpimg.name) / pathlib.Path(PHOTOS_DB).name
|
||||
FileUtil.copy(PHOTOS_DB,newdb)
|
||||
photosdb = osxphotos.PhotosDB(dbfile=newdb, verbose=print)
|
||||
captured = capsys.readouterr()
|
||||
assert "creating temporary copy" in captured.out
|
||||
Reference in New Issue
Block a user