本文整理汇总了Python中manifest.Manifest.append_dependencies_to_tree方法的典型用法代码示例。如果您正苦于以下问题:Python Manifest.append_dependencies_to_tree方法的具体用法?Python Manifest.append_dependencies_to_tree怎么用?Python Manifest.append_dependencies_to_tree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manifest.Manifest
的用法示例。
在下文中一共展示了Manifest.append_dependencies_to_tree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_append_dependencies_to_tree_dicts_invalid_version_json
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import append_dependencies_to_tree [as 别名]
def test_append_dependencies_to_tree_dicts_invalid_version_json(self):
dep_json = {
'buffer': {
'version': False
}
}
with self.assertRaises(RuntimeError) as context:
Manifest.append_dependencies_to_tree(tree(), dep_json)
示例2: test_append_dependencies_to_tree_dicts
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import append_dependencies_to_tree [as 别名]
def test_append_dependencies_to_tree_dicts(self):
dep_json = {
'buffer': {
'version': '4.0.0',
'dependencies': {
'bar': {
'version': '0.0.1',
'dependencies': {
'biz': {
'version': '0.0.2'
},
'fiz': {
'version': '9.0.0',
'from': 'git+http://github.com/fiz',
'resolved': 'git+http://github.com/fiz#abc123'
}
},
}
}
},
'io': {
'version': '0.0.1'
}
}
deps = tree()
Manifest.append_dependencies_to_tree(deps, dep_json)
expected = tree()
buffer_str = 'buffer===4.0.0===https://registry.npmjs.org/buffer/-/buffer-4.0.0.tgz'
bar_str = 'bar===0.0.1===https://registry.npmjs.org/bar/-/bar-0.0.1.tgz'
biz_str = 'biz===0.0.2===https://registry.npmjs.org/biz/-/biz-0.0.2.tgz'
io_str = 'io===0.0.1===https://registry.npmjs.org/io/-/io-0.0.1.tgz'
fiz_str = 'fiz===abc123===git+http://github.com/fiz#abc123'
expected[buffer_str][bar_str][biz_str] = tree()
expected[buffer_str][bar_str][fiz_str] = tree()
expected[io_str] = tree()
self.assertEqual(deps, expected)