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


Python Manifest.append_dependencies_to_tree方法代码示例

本文整理汇总了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)
开发者ID:sethmcl,项目名称:frosty,代码行数:11,代码来源:test_manifest.py

示例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)
开发者ID:sethmcl,项目名称:frosty,代码行数:41,代码来源:test_manifest.py


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