Esempio n. 1
0
def test_database_store_version_requires_upgrade() -> None:
    wallet_path = tempfile.mktemp()
    db_store = DatabaseStore(wallet_path)
    try:
        db_store.put("migration", DatabaseStore.INITIAL_MIGRATION - 1)
        assert db_store.requires_upgrade()
    finally:
        db_store.close()
Esempio n. 2
0
def test_database_store_version_requires_upgrade(tmp_path) -> None:
    wallet_path = os.path.join(tmp_path, "database")
    db_store = DatabaseStore(wallet_path)
    try:
        db_store.put("migration", DatabaseStore.INITIAL_MIGRATION - 1)
        assert db_store.requires_upgrade()
    finally:
        db_store.close()
Esempio n. 3
0
def test_database_store_version_requires_upgrade_esv_wallet() -> None:
    wallet_path = tempfile.mktemp()
    db_store = DatabaseStore(wallet_path)
    db_store._set_seed_version(DatabaseStore.INITIAL_SEED_VERSION)
    db_store.put("wallet_author", "ESV")
    db_store.write()
    # "ESV" marker present.
    assert db_store.requires_upgrade()