def __init__(self) -> None: self.path = tempfile.mktemp() from electrumsv.wallet_database.migration import create_database_file, update_database_file create_database_file(self.path) update_database_file(self.path) self._data = {}
def test_migrations() -> None: # Do all the migrations apply cleanly? wallet_path = os.path.join(tempfile.mkdtemp(), "wallet_create") migration.create_database_file(wallet_path)
def _db_context(): wallet_path = os.path.join(tempfile.mkdtemp(), "wallet_create") assert not os.path.exists(wallet_path) migration.create_database_file(wallet_path) return DatabaseContext(wallet_path)