本文整理汇总了Python中pants.backend.android.distribution.android_distribution.AndroidDistribution.locate_sdk_path方法的典型用法代码示例。如果您正苦于以下问题:Python AndroidDistribution.locate_sdk_path方法的具体用法?Python AndroidDistribution.locate_sdk_path怎么用?Python AndroidDistribution.locate_sdk_path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.backend.android.distribution.android_distribution.AndroidDistribution
的用法示例。
在下文中一共展示了AndroidDistribution.locate_sdk_path方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_locate_sdk_path
# 需要导入模块: from pants.backend.android.distribution.android_distribution import AndroidDistribution [as 别名]
# 或者: from pants.backend.android.distribution.android_distribution.AndroidDistribution import locate_sdk_path [as 别名]
def test_locate_sdk_path(self, path=None):
# We can set good/bad paths alike. No checks until tools are called.
@contextmanager
def env(**kwargs):
environment = dict(ANDROID_HOME=None, ANDROID_SDK_HOME=None, ANDROID_SDK=None)
environment.update(**kwargs)
with environment_as(**environment):
yield
with self.distribution() as sdk:
with env(ANDROooooD_HOME=sdk):
AndroidDistribution.locate_sdk_path(path)
with self.distribution() as sdk:
with env(ANDROID_HOME=sdk):
AndroidDistribution.locate_sdk_path(path)
示例2: test_locate_alternative_variables
# 需要导入模块: from pants.backend.android.distribution.android_distribution import AndroidDistribution [as 别名]
# 或者: from pants.backend.android.distribution.android_distribution.AndroidDistribution import locate_sdk_path [as 别名]
def test_locate_alternative_variables(self):
# Test that alternative environmental variables are accepted.
with distribution() as sdk:
with self.env(ANDROID_SDK=sdk):
dist = AndroidDistribution.locate_sdk_path()
self.assertEquals(dist._sdk_path, sdk)
示例3: test_locate_sdk_path
# 需要导入模块: from pants.backend.android.distribution.android_distribution import AndroidDistribution [as 别名]
# 或者: from pants.backend.android.distribution.android_distribution.AndroidDistribution import locate_sdk_path [as 别名]
def test_locate_sdk_path(self):
with distribution() as sdk:
with self.env(ANDROID_HOME=sdk):
dist = AndroidDistribution.locate_sdk_path()
self.assertEquals(dist._sdk_path, sdk)
示例4: test_locate_no_sdk_on_path
# 需要导入模块: from pants.backend.android.distribution.android_distribution import AndroidDistribution [as 别名]
# 或者: from pants.backend.android.distribution.android_distribution.AndroidDistribution import locate_sdk_path [as 别名]
def test_locate_no_sdk_on_path(self):
with distribution() as sdk:
with self.env(ANDROooooD_HOME=sdk):
with self.assertRaises(AndroidDistribution.DistributionError):
AndroidDistribution.locate_sdk_path()
示例5: test_locate_no_sdk_on_path
# 需要导入模块: from pants.backend.android.distribution.android_distribution import AndroidDistribution [as 别名]
# 或者: from pants.backend.android.distribution.android_distribution.AndroidDistribution import locate_sdk_path [as 别名]
def test_locate_no_sdk_on_path(self):
with self.assertRaises(AndroidDistribution.DistributionError):
with self.distribution() as sdk:
with self.env(ANDROooooD_HOME=sdk):
dist = AndroidDistribution.locate_sdk_path()
self.assertEquals(dist._sdk_path, None)