def test_set_plugin_state(self, mock_update_cherrypy, mock_config_file): mock_update_cherrypy.return_value = True with RollbackContext() as rollback: config_file_name = self._create_fake_config_file() rollback.prependDefer(os.remove, config_file_name) mock_config_file.return_value = config_file_name set_plugin_state('pluginA', False) with open(config_file_name, 'r') as f: updated_conf = f.read() self.assertEqual( updated_conf, self._get_config_file_template(enable=False) ) set_plugin_state('pluginA', True) with open(config_file_name, 'r') as f: updated_conf = f.read() self.assertEqual( updated_conf, self._get_config_file_template(enable=True) )
def disable(self, name): set_plugin_state(name, False)
def enable(self, name): set_plugin_state(name, True)
def disable(self, name): name = name.encode('utf-8') set_plugin_state(name, False)
def enable(self, name): name = name.encode('utf-8') set_plugin_state(name, True)