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


Python Cfg.set_value方法代码示例

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


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

示例1: rmttest_pos_01

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
    def rmttest_pos_01(self):
        "TxtIOConfig: check new max line length setting"
        config = Cfg()
        config.set_value('max_input_line_length', 77)

        tic = TxtIOConfig(config, 'requirement')

        assert(tic.get_max_line_length() == 77)
开发者ID:florath,项目名称:rmtoo,代码行数:10,代码来源:RMTTest-TxtIOConfig.py

示例2: rmttest_positive_03

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
    def rmttest_positive_03(self):
        "TopicSet - valid with empty requirement set"

        cfg = Cfg()
        cfg.set_value('huhuhu.directory',
                      'tests/unit-test/topic-tests/testdata/topicset01')
        cfg.set_value('huhuhu.name', 't01')
        cfg.set_value('topics.test-name02.output', {})
        cfg.set_value('topic_root_node', 'RootNode')
        tvcs = TestVCS(cfg)
        tobjcache = ObjectCache()
        tinmod = TestInputModules()
        TopicSet(cfg, tvcs, "test-name02", tobjcache, tinmod)
开发者ID:florath,项目名称:rmtoo,代码行数:15,代码来源:RMTTest-Parse.py

示例3: test_positive_02

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
 def test_positive_02(self):
     "TopicSet - valid"
     tioconfig = TxtIOConfig()
     cfg = Cfg()
     cfg.set_value('hahaha.directory',
                   'tests/unit-test/topic-tests/testdata/topicset01')
     cfg.set_value('hahaha.name', 't01')
     cfg.set_value('topics.test-name01.output', {})
     tioconfig = TxtIOConfig()
     cfg.set_value('topic_root_node', 'RootNode')
     tvcs = TestVCS(cfg)
     tobjcache = ObjectCache()
     tinmod = TestInputModules()
     topicset = TopicSet(
         cfg, tvcs, "test-name01", tobjcache, tinmod)
开发者ID:apre,项目名称:rmtoo,代码行数:17,代码来源:TestParse.py

示例4: rmttest_positive_01

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
    def rmttest_positive_01(self):
        "TopicSet - constructor with only one element"
        try:
            cfg = Cfg()
            cfg.set_value('ahah.directory',
                          'tests/unit-test/topic-tests/testdata/topicset01')
            cfg.set_value('ahah.name', 't01')
            cfg.set_value('topics.bkdkd.output', {})

            cfg.set_value('topic_root_node', 'RootNode')
            tvcs = TestVCS(cfg)
            tobjcache = ObjectCache()
            tinmod = TestInputModules()
            TopicSet(cfg, tvcs, "bkdkd", tobjcache, tinmod)
            assert False
        except AssertionError:
            pass
开发者ID:florath,项目名称:rmtoo,代码行数:19,代码来源:RMTTest-Parse.py

示例5: test_positive_02

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
 def test_positive_02(self):
     "TopicSet - valid"
     cfg = Cfg()
     cfg.set_value('hahaha.directory',
                   'tests/unit-test/topic-tests/testdata/topicset01')
     cfg.set_value('hahaha.name', 't01')
     cfg.set_value('topics.test-name01.output', {})
     tioconfig = TxtIOConfig()
     topicset = TopicSet(
         None, cfg, "test-name01", "hahaha")
开发者ID:oscarpicas,项目名称:rmtoo,代码行数:12,代码来源:TestParse.py

示例6: test_positive_01

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
 def test_positive_01(self):
     "TopicSet - constructor with only one element"
     try:
         tioconfig = TxtIOConfig()
         cfg = Cfg()
         cfg.set_value('ahah.directory',
                       'tests/unit-test/topic-tests/testdata/topicset01')
         cfg.set_value('ahah.name', 't01')
         cfg.set_value('topics.bkdkd.output', {})
         topicset = TopicSet(None, cfg, "bkdkd", "ahah")
         assert(False)
     except AssertionError, ae:
         pass
开发者ID:oscarpicas,项目名称:rmtoo,代码行数:15,代码来源:TestParse.py

示例7: test_neg_01

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
    def test_neg_01(self):
        "ReqsContinuum: check exception when vcs is needed but not available"
        try:
            tdir = tempfile.mkdtemp(prefix="rmtoo-tst-ctnt-")

            config = Cfg()
            config.set_value('requirements.input.commit_interval.begin', 'v1')
            config.set_value('requirements.input.commit_interval.end', 'v7')
            config.set_value('requirements.input.directory', tdir)

            ReqsContinuum(None, config)
            assert(False)
        except RMTException, rmte:
            shutil.rmtree(tdir)
            assert(rmte.id() == 40)
开发者ID:oscarpicas,项目名称:rmtoo,代码行数:17,代码来源:TestReqsCont.py

示例8: test_neg_02

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
    def test_neg_02(self):
        "ReqsContinuum: check exception when vcs is needed but not available \
        (entry point in execute_cmds())"

        tdir = tempfile.mkdtemp(prefix="rmtoo-tst-ctnt-")

        config = Cfg()
        config.set_value('requirements.input.commit_interval.begin', 'v1')
        config.set_value('requirements.input.commit_interval.end', 'v7')
        config.set_value('requirements.input.directory', tdir)

        mstderr = StringIO.StringIO()

        rval = execute_cmds(config, None, None, mstderr)

        assert(rval == False)
        print("ERROR IS [%s]" % mstderr.getvalue())
        assert(mstderr.getvalue() == "+++ ERROR: Problem reading in "
               "the continuum: '[  40]: Based on the config "
               "a repository is needed - but there is none'")
开发者ID:oscarpicas,项目名称:rmtoo,代码行数:22,代码来源:TestReqsCont.py

示例9: test_positive_03

# 需要导入模块: from rmtoo.lib.configuration.Cfg import Cfg [as 别名]
# 或者: from rmtoo.lib.configuration.Cfg.Cfg import set_value [as 别名]
    def test_positive_03(self):
        "TopicSet - valid with empty requirement set"

        class ReqSet(Digraph):

            def __init__(self):
                self.mods = None
                self.opts = None
                self.config = None
                self.reqs = {}

        rs = ReqSet()

        tioconfig = TxtIOConfig()
        cfg = Cfg()
        cfg.set_value('huhuhu.directory',
                      'tests/unit-test/topic-tests/testdata/topicset01')
        cfg.set_value('huhuhu.name', 't01')
        cfg.set_value('topics.test-name02.output', {})
        topicset = TopicSet(
            rs, cfg, "test-name02", "huhuhu")
开发者ID:oscarpicas,项目名称:rmtoo,代码行数:23,代码来源:TestParse.py


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