コード例 #1
0
ファイル: test_gui.py プロジェクト: heinervdm/MysticMine
    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()
コード例 #2
0
ファイル: test_gui.py プロジェクト: heinervdm/MysticMine
 def test_init(self):
     button = gui.Button()