本文整理汇总了Python中manifest.Manifest.locate_file方法的典型用法代码示例。如果您正苦于以下问题:Python Manifest.locate_file方法的具体用法?Python Manifest.locate_file怎么用?Python Manifest.locate_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manifest.Manifest
的用法示例。
在下文中一共展示了Manifest.locate_file方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import locate_file [as 别名]
def run(self):
try:
manifest = Manifest(Manifest.locate_file(self.config.cwd))
self.install(manifest)
except MissingNpmShrinkwrap as e:
Log.error(e.message)
sys.exit(1)
示例2: test_locate_missing_manifest
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import locate_file [as 别名]
def test_locate_missing_manifest(self):
cwd = relative_path('no_json')
with self.assertRaises(MissingNpmShrinkwrap) as context:
Manifest.locate_file(cwd)
示例3: test_locate_bad_path
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import locate_file [as 别名]
def test_locate_bad_path(self):
with self.assertRaises(RuntimeError) as context:
Manifest.locate_file('/sanoteh/aeonstuh/234234')
示例4: test_locate_shrinkwrap_json
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import locate_file [as 别名]
def test_locate_shrinkwrap_json(self):
cwd = relative_path('shrinkwrap_json')
actual = Manifest.locate_file(cwd)
self.assertEqual('/test_data/manifest/shrinkwrap_json' in actual, True)
示例5: test_locate_package_json
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import locate_file [as 别名]
def test_locate_package_json(self):
cwd = relative_path('package_json')
with self.assertRaises(MissingNpmShrinkwrap):
actual = Manifest.locate_file(cwd)