Private
Public Access
0
0
Files
manual_slop/tests/test_imgui_scopes_id_stability.py
T
ed 4d8e949720 fix(gui): Force newline in discussion entries to prevent squashed layout
- Insert imgui.new_line() before rendering discussion content.
- Ensures the Markdown renderer inherits the full horizontal width of the panel.
- Definitively fixes vertical squashing of tables and long text blocks.
2026-06-02 15:42:04 -04:00

30 lines
918 B
Python

import pytest
from unittest.mock import patch, MagicMock
from src.imgui_scopes import _ScopeId
import src.imgui_scopes as imgui_scopes
def test_scope_id_string():
with patch('src.imgui_scopes.imgui') as mock_imgui:
sid = _ScopeId("test_id")
with sid:
pass
mock_imgui.push_id.assert_called_once_with("test_id")
mock_imgui.pop_id.assert_called_once()
def test_scope_id_int():
with patch('src.imgui_scopes.imgui') as mock_imgui:
# Python type hint is str, but we test runtime resilience
sid = _ScopeId(1234)
with sid:
pass
# Verify it was converted to string to prevent low-level crashes
mock_imgui.push_id.assert_called_once_with("1234")
mock_imgui.pop_id.assert_called_once()
def test_id_helper_function():
with patch('src.imgui_scopes.imgui') as mock_imgui:
with imgui_scopes.id(42):
pass
mock_imgui.push_id.assert_called_once_with("42")
mock_imgui.pop_id.assert_called_once()