osxphotos/tests/test_sqlite_utils.py
Rhet Turnbull 3cb4be4254
Feature read iphone db #745 (#791)
* Added ability to read iPhone database

* Added comments

* Fixed tests

* Fixed albums for iPhone database
2022-09-11 22:26:45 -07:00

23 lines
489 B
Python

"""Tests for sqlite_utils """
import pytest
import sqlite3
from osxphotos.sqlite_utils import sqlite_open_ro, sqlite_db_is_locked
DB_UNLOCKED_10_15 = "./tests/Test-10.15.1.photoslibrary/database/photos.db"
def test_db_is_locked_unlocked():
assert not sqlite_db_is_locked(DB_UNLOCKED_10_15)
def test_open_sqlite_ro():
conn, cur = sqlite_open_ro(DB_UNLOCKED_10_15)
assert isinstance(conn, sqlite3.Connection)
assert isinstance(cur, sqlite3.Cursor)
conn.close()