def test_get_loaded_extensions(self): ext = extension.CementExtensionHandler() ext._setup(self.app) res = 'cement.ext.ext_json' not in ext.get_loaded_extensions() self.ok(res) ext.load_extensions(['json']) res = 'cement.ext.ext_json' in ext.get_loaded_extensions() self.ok(res)
def test_passed_handlers(self): from cement.ext import ext_configparser from cement.ext import ext_logging from cement.ext import ext_argparse from cement.ext import ext_plugin from cement.ext import ext_nulloutput # forces CementApp._resolve_handler to register the handler from cement.ext import ext_json app = self.make_app('my-app-test', config_handler=ext_configparser.ConfigParserConfigHandler, log_handler=ext_logging.LoggingLogHandler(), arg_handler=ext_argparse.ArgParseArgumentHandler(), extension_handler=extension.CementExtensionHandler(), plugin_handler=ext_plugin.CementPluginHandler(), output_handler=ext_json.JsonOutputHandler(), argv=[__file__, '--debug'] ) app.setup()
def test_load_bogus_extension(self): ext = extension.CementExtensionHandler() ext._setup(self.app) ext.load_extensions(['bogus'])
def test_load_extensions_again(self): ext = extension.CementExtensionHandler() ext._setup(self.app) ext.load_extensions(['cement.ext.ext_configparser']) ext.load_extensions(['cement.ext.ext_configparser'])