本文整理汇总了Python中build_pack_utils.BuildPack._detect方法的典型用法代码示例。如果您正苦于以下问题:Python BuildPack._detect方法的具体用法?Python BuildPack._detect怎么用?Python BuildPack._detect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类build_pack_utils.BuildPack
的用法示例。
在下文中一共展示了BuildPack._detect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_detect_with_asp_net_app
# 需要导入模块: from build_pack_utils import BuildPack [as 别名]
# 或者: from build_pack_utils.BuildPack import _detect [as 别名]
def test_detect_with_asp_net_app(self):
shutil.copytree('tests/data/app-asp-net', self.build_dir)
bp = BuildPack({
'BUILD_DIR': self.build_dir,
'CACHE_DIR': self.cache_dir,
'WEBDIR': 'htdocs'
}, '.')
# simulate clone, makes debugging easier
os.rmdir(bp.bp_dir)
shutil.copytree('.', bp.bp_dir,
ignore=shutil.ignore_patterns("binaries",
"env",
"tests"))
try:
bp._detect().strip()
except Exception, e:
print e.output
assert re.match('no', e.output)
示例2: test_detect_static
# 需要导入模块: from build_pack_utils import BuildPack [as 别名]
# 或者: from build_pack_utils.BuildPack import _detect [as 别名]
def test_detect_static(self):
shutil.copytree('tests/data/app-3', self.build_dir)
bp = BuildPack({
'BUILD_DIR': self.build_dir,
'CACHE_DIR': self.cache_dir,
'WEBDIR': 'htdocs'
}, '.')
# simulate clone, makes debugging easier
os.rmdir(bp.bp_dir)
shutil.copytree('.', bp.bp_dir,
ignore=shutil.ignore_patterns("binaries",
"env",
"tests"))
try:
output = bp._detect().strip()
assert re.match('php*', output)
except Exception, e:
print str(e)
if hasattr(e, 'output'):
print e.output
raise
示例3: test_detect_php
# 需要导入模块: from build_pack_utils import BuildPack [as 别名]
# 或者: from build_pack_utils.BuildPack import _detect [as 别名]
def test_detect_php(self):
shutil.copytree('tests/data/app-2', self.build_dir)
bp = BuildPack({
'BUILD_DIR': self.build_dir,
'CACHE_DIR': self.cache_dir
}, '.')
# simulate clone, makes debugging easier
os.rmdir(bp.bp_dir)
shutil.copytree('.', bp.bp_dir,
ignore=shutil.ignore_patterns("binaries",
"env",
"tests"))
try:
output = bp._detect().strip()
eq_('PHP', output)
except Exception, e:
print str(e)
if hasattr(e, 'output'):
print e.output
if output:
print output
raise