Files
attack_module/scripts/test_db.py
2025-06-02 14:53:57 +03:00

26 lines
881 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from src.core.database.database import Database
from src.core.database.managers.session_manager import SessionManager
def main():
db = Database()
session_manager = SessionManager(db)
# Создаем сессию с именем
session = session_manager.create_session(name="Test Session 1")
print(f"Created session: {session}")
# Получаем все сессии
sessions = session_manager.get_all_sessions()
print(f"All sessions: {sessions}")
# Обновляем имя сессии
session_manager.update_session_name(session.id, "Updated Test Session")
updated_session = session_manager.get_session(session.id)
print(f"Updated session: {updated_session}")
# Удаляем сессию
session_manager.delete_session(session.id)
print(f"Deleted session {session.id}")
if __name__ == "__main__":
main()