from core.account_manager import AccountManager def test_crud_operations(tmp_path): db_file = tmp_path / "accounts.json" manager = AccountManager(db_file) # Добавление manager.add_user("alice", "hash1", "salt1") assert "alice" in manager.list_users() # Чтение user = manager.get_user("alice") assert user["hash"] == "hash1" # Обновление assert manager.update_user("alice", "hash2", "salt2") user = manager.get_user("alice") assert user["hash"] == "hash2" # Удаление assert manager.delete_user("alice") assert "alice" not in manager.list_users()