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)
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()
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()
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()
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()
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'))
def tearDown(self): cleanup()
def tearDown(self): cleanup() self.assertEqual(len(config.iterate_autoload_presets()), 0)