예제 #1
0
def test_define_duplicate_namespace():  
    bogus = CementNamespace(
        label='root', 
        controller='RootController',
        version='1.0', 
        required_api='xxxx', 
        provider='cement_test')
    define_namespace('root', bogus)
예제 #2
0
    except AssertionError, error:
        raise CementConfigError, error.message
     
    if not banner:
        banner = "%s version %s" % (
            config['app_name'],
            version)
        
    namespace = CementNamespace(
        label='root',
        version=version,
        config=get_default_config(),
        banner=banner,
        provider=config['app_module']
        )
    define_namespace('root', namespace)
    namespaces['root'].config.update(config)
    
    root_mod = __import__("%s.controllers.root" % \
                          namespaces['root'].config['app_module'], 
                          globals(), locals(), ['root'])
    namespaces['root'].controller = getattr(root_mod, 'RootController')
        
    for config_file in namespaces['root'].config['config_files']:
        set_config_opts_per_file('root', 'root', config_file)

    validate_config(namespaces['root'].config)
    
    # hardcoded hacks
    if '--quiet' in sys.argv:
        namespaces['root'].config['log_to_console'] = False