本文整理汇总了Python中pants.java.distribution.distribution.Distribution.find_libs方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.find_libs方法的具体用法?Python Distribution.find_libs怎么用?Python Distribution.find_libs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.java.distribution.distribution.Distribution
的用法示例。
在下文中一共展示了Distribution.find_libs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_validated_library
# 需要导入模块: from pants.java.distribution.distribution import Distribution [as 别名]
# 或者: from pants.java.distribution.distribution.Distribution import find_libs [as 别名]
def test_validated_library(self):
with distribution(executables=EXE('bin/java')) as dist_root:
with self.assertRaises(Distribution.Error):
Distribution(bin_path=os.path.join(dist_root, 'bin')).find_libs(['tools.jar'])
with distribution(executables=EXE('bin/java'), files='lib/tools.jar') as dist_root:
dist = Distribution(bin_path=os.path.join(dist_root, 'bin'))
self.assertEqual([os.path.join(dist_root, 'lib', 'tools.jar')],
dist.find_libs(['tools.jar']))
with distribution(executables=[EXE('jre/bin/java'), EXE('bin/javac')],
files=['lib/tools.jar', 'jre/lib/rt.jar'],
java_home='jre') as dist_root:
dist = Distribution(bin_path=os.path.join(dist_root, 'jre/bin'))
self.assertEqual([os.path.join(dist_root, 'lib', 'tools.jar'),
os.path.join(dist_root, 'jre', 'lib', 'rt.jar')],
dist.find_libs(['tools.jar', 'rt.jar']))