本文整理汇总了Python中zato.elem.Elem.a[2]方法的典型用法代码示例。如果您正苦于以下问题:Python Elem.a[2]方法的具体用法?Python Elem.a[2]怎么用?Python Elem.a[2]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zato.elem.Elem
的用法示例。
在下文中一共展示了Elem.a[2]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_append_to_list6
# 需要导入模块: from zato.elem import Elem [as 别名]
# 或者: from zato.elem.Elem import a[2] [as 别名]
def test_append_to_list6(self):
doc = Elem()
doc.a[0] = 123
doc.a.append(456)
doc.a[2] = 789
expected = {"a": [123, 456, 789]}
out = doc.to_dict()
self.assertDictEqual(expected, out)
示例2: xtest_top_level_list_value5
# 需要导入模块: from zato.elem import Elem [as 别名]
# 或者: from zato.elem.Elem import a[2] [as 别名]
def xtest_top_level_list_value5(self):
doc = Elem()
doc.a[0] = 'a0'
doc.a[1]
doc.a[2] = 'a2'
expected = {'a':['a0', None, 'a2']}
out = doc.to_dict()
self.assertDictEqual(expected, out)