Updated PhotosDB to only copy database if locked, speed improvement for cases where DB not locked; closes #34

This commit is contained in:
Rhet Turnbull
2020-01-30 05:38:11 -08:00
parent 27994c9fd3
commit ac8be51156
155 changed files with 717 additions and 27 deletions

View File

@@ -1,5 +1,9 @@
import pytest
DB_LOCKED_10_12 = "./tests/Test-Lock-10_12.photoslibrary/database/photos.db"
DB_LOCKED_10_15 = "./tests/Test-Lock-10_15_1.photoslibrary/database/Photos.sqlite"
DB_UNLOCKED_10_15 = "./tests/Test-10.15.1.photoslibrary/database/photos.db"
def test_debug_enable():
import osxphotos
@@ -35,3 +39,15 @@ def test_get_system_library_path():
else:
assert osxphotos.utils.get_system_library_path() is not None
def test_db_is_locked_locked():
import osxphotos
assert osxphotos.utils._db_is_locked(DB_LOCKED_10_12)
assert osxphotos.utils._db_is_locked(DB_LOCKED_10_15)
def test_db_is_locked_unlocked():
import osxphotos
assert not osxphotos.utils._db_is_locked(DB_UNLOCKED_10_15)