当前位置: 首页>>代码示例>>Python>>正文


Python Configurable.configure方法代码示例

本文整理汇总了Python中aspen.configuration.Configurable.configure方法的典型用法代码示例。如果您正苦于以下问题:Python Configurable.configure方法的具体用法?Python Configurable.configure怎么用?Python Configurable.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aspen.configuration.Configurable的用法示例。


在下文中一共展示了Configurable.configure方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_nirvana

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_nirvana():
    logging.getLogger().handlers = []  # override nose logging nosiness
    c = Configurable()
    c.configure(['-vNIRVANA'])
    actual = c.log_level
    expected = sys.maxint
    assert actual == expected, actual
开发者ID:buchuki,项目名称:aspen,代码行数:9,代码来源:test_configuration.py

示例2: test_configurable_sees_root_option

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_configurable_sees_root_option():
    mk()
    c = Configurable()
    c.configure(['--root', FSFIX])
    expected = os.getcwd()
    actual = c.root
    assert actual == expected, actual
开发者ID:buchuki,项目名称:aspen,代码行数:9,代码来源:test_configuration.py

示例3: test_root_defaults_to_cwd

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_root_defaults_to_cwd():
    mk()
    c = Configurable()
    c.configure([])
    expected = os.getcwd()
    actual = c.root
    assert actual == expected, actual
开发者ID:buchuki,项目名称:aspen,代码行数:9,代码来源:test_configuration.py

示例4: test_ConfigurationError_NOT_raised_if_no_cwd_but_do_have__www_root

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_ConfigurationError_NOT_raised_if_no_cwd_but_do_have__www_root(harness):
    foo = os.getcwd()
    os.chdir(harness.fs.project.resolve(''))
    os.rmdir(os.getcwd())
    c = Configurable()
    c.configure(['--www_root', foo])
    assert c.www_root == foo
开发者ID:Acidburn0zzz,项目名称:aspen-python,代码行数:9,代码来源:test_configuration.py

示例5: test_www_root_defaults_to_cwd

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_www_root_defaults_to_cwd():
    mk()
    c = Configurable()
    c.configure([])
    expected = os.path.realpath(os.getcwd())
    actual = c.www_root
    assert actual == expected, actual
开发者ID:ArmstrongJ,项目名称:aspen-python,代码行数:9,代码来源:test_configuration.py

示例6: test_ConfigurationError_NOT_raised_if_no_cwd_but_do_have___root

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_ConfigurationError_NOT_raised_if_no_cwd_but_do_have___root():
    mk()
    foo = os.getcwd()
    os.chdir(FSFIX)
    os.rmdir(os.getcwd())
    c = Configurable()
    c.configure(['--root', foo])
    expected = foo
    actual = c.root
    assert actual == expected, actual
开发者ID:buchuki,项目名称:aspen,代码行数:12,代码来源:test_configuration.py

示例7: test_defaults_to_defaults

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_defaults_to_defaults(harness):
    c = Configurable()
    c.configure()
    actual = ( c.logging_threshold
             , c.project_root
             , c.www_root

             , c.changes_reload
             , c.charset_dynamic
             , c.charset_static
             , c.indices
             , c.list_directories
             , c.media_type_default
             , c.media_type_json
             , c.renderer_default
             , c.show_tracebacks
              )
    expected = ( 0, None, os.getcwd(), False, 'UTF-8', None
               , ['index.html', 'index.json', 'index', 'index.html.spt', 'index.json.spt', 'index.spt']
               , False, 'text/plain', 'application/json', 'stdlib_percent', False
                )
    assert actual == expected
开发者ID:jaraco,项目名称:aspen,代码行数:24,代码来源:test_configuration.py

示例8: test_configurable_sees_root_option

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_configurable_sees_root_option(harness):
    c = Configurable()
    c.configure(['--www_root', harness.fs.project.resolve('')])
    expected = harness.fs.project.root
    actual = c.www_root
    assert actual == expected
开发者ID:Acidburn0zzz,项目名称:aspen-python,代码行数:8,代码来源:test_configuration.py

示例9: test_logging_threshold_goes_to_eleven

# 需要导入模块: from aspen.configuration import Configurable [as 别名]
# 或者: from aspen.configuration.Configurable import configure [as 别名]
def test_logging_threshold_goes_to_eleven():
    c = Configurable()
    c.configure(logging_threshold='11')
    assert c.logging_threshold == 11
开发者ID:jaraco,项目名称:aspen,代码行数:6,代码来源:test_configuration.py


注:本文中的aspen.configuration.Configurable.configure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。