Exemple #1
0
 def test_global_callback_button_missmatch(self, mock_input, mock_select):
     self.input.register_callback(self.anyModule,
                                  button=1,
                                  cmd=self.callback)
     assertMouseEvent(mock_input, None, mock_select, self, None,
                      bumblebee.input.RIGHT_MOUSE, None, "someinstance")
     self.assertTrue(self._called == 0)
Exemple #2
0
 def test_custom_step(self, mock_input, mock_output, mock_select):
     self.config.set("brightness.step", "10")
     module = Module(engine=self.engine, config={ "config": self.config })
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
         module, bumblebee.input.WHEEL_DOWN,
         "xbacklight -10%"
     )
Exemple #3
0
 def test_module_callback(self, mock_input, mock_select):
     self.input.register_callback(self.anyModule,
                                  button=1,
                                  cmd=self.callback)
     assertMouseEvent(mock_input, None, mock_select, self, self.anyModule,
                      bumblebee.input.LEFT_MOUSE, None)
     self.assertTrue(self._called > 0)
Exemple #4
0
 def test_widget_callback(self, mock_input, mock_select):
     self.input.register_callback(self.anyWidget,
                                  button=1,
                                  cmd=self.callback)
     assertMouseEvent(mock_input, None, mock_select, self, None,
                      bumblebee.input.LEFT_MOUSE, None, self.anyWidget.id)
     self.assertTrue(self._called > 0)
Exemple #5
0
 def test_remove_module_callback(self, mock_input, mock_select):
     self.input.register_callback(self.anyModule,
                                  button=1,
                                  cmd=self.callback)
     self.input.deregister_callbacks(self.anyModule)
     assertMouseEvent(mock_input, None, mock_select, self, None,
                      bumblebee.input.LEFT_MOUSE, None, self.anyWidget.id)
     self.assertTrue(self._called == 0)
Exemple #6
0
 def test_widget_cmd_callback(self, mock_input, mock_output, mock_select):
     self.input.register_callback(self.anyWidget, button=1, cmd="echo")
     assertMouseEvent(mock_input, mock_output, mock_select, self, None,
                      bumblebee.input.LEFT_MOUSE, "echo", self.anyWidget.id)
Exemple #7
0
 def test_wheeldown(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
                      self.module, bumblebee.input.WHEEL_DOWN,
                      "pactl set-source-volume @DEFAULT_SOURCE@ -2%")
 def test_remove_global_callback(self, mock_input, mock_select):
     self.input.register_callback(None, button=1, cmd=self.callback)
     self.input.deregister_callbacks(None)
     assertMouseEvent(mock_input, None, mock_select, self, None,
         bumblebee.input.LEFT_MOUSE, None, "someinstance")
     self.assertTrue(self._called == 0)
Exemple #9
0
 def test_rightclick(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
                      self.module, bumblebee.input.RIGHT_MOUSE,
                      "pavucontrol")
Exemple #10
0
 def test_leftclick(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
         self.module, bumblebee.input.LEFT_MOUSE,
         "gnome-system-monitor"
     )
Exemple #11
0
 def test_wheel_down(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
         self.module, bumblebee.input.WHEEL_DOWN,
         "xbacklight -2%"
     )
 def test_rightclick(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
         self.module, bumblebee.input.RIGHT_MOUSE,
         "pavucontrol"
     )
 def test_wheeldown(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
         self.module, bumblebee.input.WHEEL_DOWN,
         "pactl set-source-volume @DEFAULT_SOURCE@ -2%"
     )
 def test_leftclick(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
         self.module, bumblebee.input.LEFT_MOUSE,
         "pactl set-source-mute @DEFAULT_SOURCE@ toggle"
     )
 def test_module_callback(self, mock_input, mock_select):
     self.input.register_callback(self.anyModule, button=1, cmd=self.callback)
     assertMouseEvent(mock_input, None, mock_select, self, self.anyModule,
         bumblebee.input.LEFT_MOUSE, None)
     self.assertTrue(self._called > 0)
 def test_global_callback_button_missmatch(self, mock_input, mock_select):
     self.input.register_callback(self.anyModule, button=1, cmd=self.callback)
     assertMouseEvent(mock_input, None, mock_select, self, None,
         bumblebee.input.RIGHT_MOUSE, None, "someinstance")
     self.assertTrue(self._called == 0)
Exemple #17
0
 def test_remove_global_callback(self, mock_input, mock_select):
     self.input.register_callback(None, button=1, cmd=self.callback)
     self.input.deregister_callbacks(None)
     assertMouseEvent(mock_input, None, mock_select, self, None,
                      bumblebee.input.LEFT_MOUSE, None, "someinstance")
     self.assertTrue(self._called == 0)
 def test_widget_callback(self, mock_input, mock_select):
     self.input.register_callback(self.anyWidget, button=1, cmd=self.callback)
     assertMouseEvent(mock_input, None, mock_select, self, None,
         bumblebee.input.LEFT_MOUSE, None, self.anyWidget.id)
     self.assertTrue(self._called > 0)
Exemple #19
0
 def test_leftclick(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
                      self.module, bumblebee.input.LEFT_MOUSE,
                      "gnome-system-monitor")
 def test_widget_cmd_callback(self, mock_input, mock_output, mock_select):
     self.input.register_callback(self.anyWidget, button=1, cmd="echo")
     assertMouseEvent(mock_input, mock_output, mock_select, self, None,
         bumblebee.input.LEFT_MOUSE, "echo", self.anyWidget.id)
Exemple #21
0
 def test_leftclick(self, mock_input, mock_output, mock_select):
     assertMouseEvent(mock_input, mock_output, mock_select, self.engine,
                      self.module, bumblebee.input.LEFT_MOUSE,
                      "pactl set-source-mute @DEFAULT_SOURCE@ toggle")
 def test_remove_module_callback(self, mock_input, mock_select):
     self.input.register_callback(self.anyModule, button=1, cmd=self.callback)
     self.input.deregister_callbacks(self.anyModule)
     assertMouseEvent(mock_input, None, mock_select, self, None,
         bumblebee.input.LEFT_MOUSE, None, self.anyWidget.id)
     self.assertTrue(self._called == 0)