def test_cannot_hover(self, _init_pygame, default_ui_manager): button = UIButton(relative_rect=pygame.Rect(100, 100, 150, 30), text="Test Button", manager=default_ui_manager) button.is_enabled = True button.held = True assert button.can_hover() is False
def test_can_hover(self, _init_pygame, default_ui_manager, _display_surface_return_none): button = UIButton(relative_rect=pygame.Rect(100, 100, 150, 30), text="Test Button", manager=default_ui_manager) button.is_enabled = True button.held = False assert button.can_hover() is True
def test_hover_point_not_held(self, _init_pygame, default_ui_manager): button = UIButton(relative_rect=pygame.Rect(100, 100, 150, 30), text="Test Button", manager=default_ui_manager) # test inside button when held button.set_hold_range((100, 100)) button.held = False is_inside = button.hover_point(50, 50) assert is_inside is False