本文整理汇总了Python中ConfigParser.InterpolationDepthError方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigParser.InterpolationDepthError方法的具体用法?Python ConfigParser.InterpolationDepthError怎么用?Python ConfigParser.InterpolationDepthError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigParser
的用法示例。
在下文中一共展示了ConfigParser.InterpolationDepthError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_interpolation
# 需要导入模块: import ConfigParser [as 别名]
# 或者: from ConfigParser import InterpolationDepthError [as 别名]
def test_interpolation(self):
rawval = {
ConfigParser.ConfigParser: ("something %(with11)s "
"lots of interpolation (11 steps)"),
ConfigParser.SafeConfigParser: "%(with1)s",
}
cf = self.get_interpolation_config()
eq = self.assertEqual
eq(cf.get("Foo", "getname"), "Foo")
eq(cf.get("Foo", "bar"), "something with interpolation (1 step)")
eq(cf.get("Foo", "bar9"),
"something with lots of interpolation (9 steps)")
eq(cf.get("Foo", "bar10"),
"something with lots of interpolation (10 steps)")
self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11")
示例2: test_interpolationdeptherror
# 需要导入模块: import ConfigParser [as 别名]
# 或者: from ConfigParser import InterpolationDepthError [as 别名]
def test_interpolationdeptherror(self):
import pickle
e1 = ConfigParser.InterpolationDepthError('option', 'section',
'rawval')
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickled = pickle.dumps(e1, proto)
e2 = pickle.loads(pickled)
self.assertEqual(e1.message, e2.message)
self.assertEqual(e1.args, e2.args)
self.assertEqual(e1.section, e2.section)
self.assertEqual(e1.option, e2.option)
self.assertEqual(repr(e1), repr(e2))
示例3: test_interpolationdeptherror
# 需要导入模块: import ConfigParser [as 别名]
# 或者: from ConfigParser import InterpolationDepthError [as 别名]
def test_interpolationdeptherror(self):
import pickle
e1 = ConfigParser.InterpolationDepthError('option', 'section',
'rawval')
pickled = pickle.dumps(e1)
e2 = pickle.loads(pickled)
self.assertEqual(e1.message, e2.message)
self.assertEqual(e1.args, e2.args)
self.assertEqual(e1.section, e2.section)
self.assertEqual(e1.option, e2.option)
self.assertEqual(repr(e1), repr(e2))
示例4: test_interpolation
# 需要导入模块: import ConfigParser [as 别名]
# 或者: from ConfigParser import InterpolationDepthError [as 别名]
def test_interpolation(self):
cf = self.get_interpolation_config()
eq = self.assertEqual
eq(cf.get("Foo", "getname"), "Foo")
eq(cf.get("Foo", "bar"), "something with interpolation (1 step)")
eq(cf.get("Foo", "bar9"),
"something with lots of interpolation (9 steps)")
eq(cf.get("Foo", "bar10"),
"something with lots of interpolation (10 steps)")
self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11")