Exemplo n.º 1
0
 def test_restore_os_environ(self):
     os.environ['foo'] = 'bar'
     del os.environ['USER']
     environ = os.environ
     cleanup()
     self.assertIn('USER', environ)
     self.assertNotIn('foo', environ)
Exemplo n.º 2
0
 def tearDown(self):
     self.window.on_close = self.original_on_close
     self.window.on_apply_system_layout_clicked(None)
     gtk_iteration()
     self.window.on_close()
     self.window.window.destroy()
     gtk_iteration()
     cleanup()
Exemplo n.º 3
0
    def tearDown(self):
        # make sure all macros are stopped by tests
        for macro in active_macros.values():
            if macro.holding:
                macro.release_key()
            self.assertFalse(macro.holding)
            self.assertFalse(macro.running)

        cleanup()
Exemplo n.º 4
0
    def tearDown(self):
        utils.should_map_event_as_btn = original_smeab

        if self.injector is not None:
            self.injector.stop_injecting()
            self.injector = None
        evdev.InputDevice.grab = self.grab

        cleanup()
Exemplo n.º 5
0
    def tearDown(self):
        # avoid race conditions with other tests, daemon may run processes
        if self.daemon is not None:
            self.daemon.stop()
            self.daemon = None
        evdev.InputDevice.grab = self.grab

        subprocess.check_output = check_output
        type(SystemBus()).get = dbus_get

        cleanup()
Exemplo n.º 6
0
 def test_restore_fixtures(self):
     fixtures[1] = [1234]
     del fixtures['/dev/input/event11']
     cleanup()
     self.assertIsNone(fixtures.get(1))
     self.assertIsNotNone(fixtures.get('/dev/input/event11'))
Exemplo n.º 7
0
 def tearDown(self):
     cleanup()
Exemplo n.º 8
0
 def tearDown(self):
     cleanup()
     self.assertEqual(len(config.iterate_autoload_presets()), 0)