def test_not_clicked_when_mousepress_outside(self): """Given a button when mouse clicks outside then button shouldn't return clicked state""" # Given button = gui.Button(Rectangle(100, 100, 50, 50)) userinput = UserInput() guistate = gui.GuiState() assert not button.went_down() # When userinput.mouse.feed_pos(Vec2D(110, 90)) userinput.mouse.feed_down(Mouse.LEFT) button.tick(userinput, guistate) # Then assert not button.went_down()
def test_init(self): button = gui.Button()