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


Python ConfigDict.set方法代码示例

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


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

示例1: test_get_set

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
 def test_get_set(self):
     cd = ConfigDict()
     self.assertRaises(KeyError, cd.get, "foo", "core")
     cd.set(("core", ), "foo", "bla")
     self.assertEquals("bla", cd.get(("core", ), "foo"))
     cd.set(("core", ), "foo", "bloe")
     self.assertEquals("bloe", cd.get(("core", ), "foo"))
开发者ID:kankri,项目名称:dulwich,代码行数:9,代码来源:test_config.py

示例2: test_iteritems

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
    def test_iteritems(self):
        cd = ConfigDict()
        cd.set((b"core", ), b"foo", b"bla")
        cd.set((b"core2", ), b"foo", b"bloe")

        self.assertEqual(
            [(b'foo', b'bla')],
            list(cd.iteritems((b"core", ))))
开发者ID:stevegt,项目名称:dulwich,代码行数:10,代码来源:test_config.py

示例3: test_dict

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
    def test_dict(self):
        cd = ConfigDict()
        cd.set((b"core", ), b"foo", b"bla")
        cd.set((b"core2", ), b"foo", b"bloe")

        self.assertEqual([(b"core", ), (b"core2", )], list(cd.keys()))
        self.assertEqual(cd[(b"core", )], {b'foo': b'bla'})

        cd[b'a'] = b'b'
        self.assertEqual(cd[b'a'], b'b')
开发者ID:stevegt,项目名称:dulwich,代码行数:12,代码来源:test_config.py

示例4: test_dict

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
    def test_dict(self):
        cd = ConfigDict()
        cd.set(("core", ), "foo", "bla")
        cd.set(("core2", ), "foo", "bloe")

        self.assertEqual([("core2", ), ("core", )], cd.keys())
        self.assertEqual(cd[("core", )], {'foo': 'bla'})

        cd['a'] = 'b'
        self.assertEqual(cd['a'], 'b')
开发者ID:eode,项目名称:dulwich,代码行数:12,代码来源:test_config.py

示例5: test_config_proxy

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
    def test_config_proxy(self):
        config = ConfigDict()
        config.set(b'http', b'proxy', b'http://localhost:3128/')
        manager = default_urllib3_manager(config=config)

        self.assertIsInstance(manager, urllib3.ProxyManager)
        self.assertTrue(hasattr(manager, 'proxy'))
        self.assertEqual(manager.proxy.scheme, 'http')
        self.assertEqual(manager.proxy.host, 'localhost')
        self.assertEqual(manager.proxy.port, 3128)
开发者ID:jelmer,项目名称:dulwich,代码行数:12,代码来源:test_client.py

示例6: test_get_boolean

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
 def test_get_boolean(self):
     cd = ConfigDict()
     cd.set(("core", ), "foo", "true")
     self.assertTrue(cd.get_boolean(("core", ), "foo"))
     cd.set(("core", ), "foo", "false")
     self.assertFalse(cd.get_boolean(("core", ), "foo"))
     cd.set(("core", ), "foo", "invalid")
     self.assertRaises(ValueError, cd.get_boolean, ("core", ), "foo")
开发者ID:kankri,项目名称:dulwich,代码行数:10,代码来源:test_config.py

示例7: test_itersections

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
    def test_itersections(self):
        cd = ConfigDict()
        cd.set((b"core2", ), b"foo", b"bloe")

        self.assertEqual([(b"core2", )],
            list(cd.itersections()))
开发者ID:stevegt,项目名称:dulwich,代码行数:8,代码来源:test_config.py

示例8: test_iteritems_nonexistant

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
    def test_iteritems_nonexistant(self):
        cd = ConfigDict()
        cd.set((b"core2", ), b"foo", b"bloe")

        self.assertEqual([],
            list(cd.iteritems((b"core", ))))
开发者ID:stevegt,项目名称:dulwich,代码行数:8,代码来源:test_config.py

示例9: test_config_no_ssl

# 需要导入模块: from dulwich.config import ConfigDict [as 别名]
# 或者: from dulwich.config.ConfigDict import set [as 别名]
 def test_config_no_ssl(self):
     config = ConfigDict()
     config.set(b'http', b'sslVerify', b'false')
     manager = default_urllib3_manager(config=config)
     self.assertEqual(manager.connection_pool_kw['cert_reqs'],
                      'CERT_NONE')
开发者ID:jelmer,项目名称:dulwich,代码行数:8,代码来源:test_client.py


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