mirror of
https://github.com/Quad4-Software/MeshChatX.git
synced 2026-08-18 09:49:09 -04:00
14 lines
544 B
Python
14 lines
544 B
Python
# SPDX-License-Identifier: 0BSD
|
|
|
|
from meshchatx.src.backend.database import Database
|
|
|
|
|
|
def test_apply_memory_pressure_pragmas_roundtrip(tmp_path):
|
|
db = Database(str(tmp_path / "pressure.db"))
|
|
db.initialize()
|
|
assert db.apply_memory_pressure_pragmas(True) is True
|
|
assert db._sqlite_memory_relaxed is True
|
|
assert db._get_pragma_value("temp_store") == 1 # FILE
|
|
assert db.apply_memory_pressure_pragmas(False) is True
|
|
assert db._sqlite_memory_relaxed is False
|
|
assert db._get_pragma_value("temp_store") == 2 # MEMORY
|