def test_remove_window(self, _init_pygame, default_ui_manager, _display_surface_return_none): stack = UIWindowStack((800, 600), default_ui_manager.get_root_container()) window = UIWindow(pygame.Rect(100, 100, 200, 200), window_display_title="Test Window", manager=default_ui_manager, element_id='test_window') window_2 = UIWindow(pygame.Rect(50, 50, 200, 200), window_display_title="Test Window", manager=default_ui_manager, element_id='test_window') window_3 = UIWindow(pygame.Rect(0, 0, 200, 200), window_display_title="Test Window", manager=default_ui_manager, element_id='test_window') stack.add_new_window(window) stack.add_new_window(window_2) stack.add_new_window(window_3) stack.remove_window(window) stack.remove_window(window_2) stack.remove_window(window_3) assert len(stack.stack) == 0
def test_remove_window(self, _init_pygame, default_ui_manager): stack = UIWindowStack((800, 600)) window = UIWindow(pygame.Rect(100, 100, 200, 200), manager=default_ui_manager, element_ids=[]) window_2 = UIWindow(pygame.Rect(50, 50, 200, 200), manager=default_ui_manager, element_ids=[]) window_3 = UIWindow(pygame.Rect(0, 0, 200, 200), manager=default_ui_manager, element_ids=[]) stack.add_new_window(window) stack.add_new_window(window_2) stack.add_new_window(window_3) stack.remove_window(window) stack.remove_window(window_2) stack.remove_window(window_3) assert len(stack.stack) == 0