• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python android_distribution.AndroidDistribution类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pants.backend.android.distribution.android_distribution.AndroidDistribution的典型用法代码示例。如果您正苦于以下问题:Python AndroidDistribution类的具体用法?Python AndroidDistribution怎么用?Python AndroidDistribution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了AndroidDistribution类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_caching_multiple_sdks

 def test_caching_multiple_sdks(self):
     with distribution() as first_sdk_path:
         with distribution() as second_sdk_path:
             first_sdk_instance = AndroidDistribution.cached(first_sdk_path)
             second_sdk_instance = AndroidDistribution.cached(second_sdk_path)
             self.assertEquals(AndroidDistribution._CACHED_SDK[first_sdk_path], first_sdk_instance)
             self.assertEquals(AndroidDistribution._CACHED_SDK[second_sdk_path], second_sdk_instance)
开发者ID:jduan,项目名称:pants,代码行数:7,代码来源:test_android_distribution.py


示例2: test_get_bad_tool_path

 def test_get_bad_tool_path(self):
     with self.assertRaises(AndroidDistribution.DistributionError):
         with distribution() as sdk:
             android_sdk = AndroidDistribution.cached(sdk)
             android_jar = os.path.join("platforms", "android-19", "no.jar")
             tool_path = android_sdk._get_tool_path(android_jar)
             self.assertEquals(tool_path, os.path.join(sdk, android_jar))
开发者ID:pcurry,项目名称:pants,代码行数:7,代码来源:test_android_distribution.py


示例3: test_register_tool_returns_file

 def test_register_tool_returns_file(self):
     with distribution() as sdk:
         with temporary_dir() as workdir:
             android_sdk = AndroidDistribution.cached(sdk)
             android_jar = os.path.join("platforms", "android-19", "android.jar")
             android_sdk.register_android_tool(android_jar, workdir=workdir)
             self.assertEquals(os.path.isfile(android_sdk._validated_tools[android_jar]), True)
开发者ID:jduan,项目名称:pants,代码行数:7,代码来源:test_android_distribution.py


示例4: test_register_copy_is_validated

 def test_register_copy_is_validated(self):
     with distribution() as sdk:
         with temporary_dir() as workdir:
             android_sdk = AndroidDistribution.cached(sdk)
             android_jar = os.path.join("platforms", "android-19", "android.jar")
             android_sdk.register_android_tool(android_jar, workdir=workdir)
             self.assertIn(android_jar, android_sdk._validated_tools)
开发者ID:jduan,项目名称:pants,代码行数:7,代码来源:test_android_distribution.py


示例5: test_register_copy_but_no_tool

 def test_register_copy_but_no_tool(self):
     with distribution() as sdk:
         with temporary_dir() as workdir:
             android_sdk = AndroidDistribution.cached(sdk)
             android_jar = os.path.join("platforms", "android-19", "no.jar")
             with self.assertRaises(AndroidDistribution.DistributionError):
                 android_sdk.register_android_tool(android_jar, workdir=workdir)
开发者ID:jduan,项目名称:pants,代码行数:7,代码来源:test_android_distribution.py


示例6: test_register_tool_no_permission

 def test_register_tool_no_permission(self):
     with self.assertRaises(AndroidDistribution.DistributionError):
         with distribution() as sdk:
             with temporary_dir() as workdir:
                 os.chmod(workdir, 0o400)
                 android_sdk = AndroidDistribution.cached(sdk)
                 android_jar = os.path.join("platforms", "android-19", "android.jar")
                 android_sdk.register_android_tool(android_jar, workdir=workdir)
开发者ID:pcurry,项目名称:pants,代码行数:8,代码来源:test_android_distribution.py


示例7: test_locate_sdk_path

  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)
开发者ID:arloherrine,项目名称:pants,代码行数:17,代码来源:test_android_distribution.py


示例8: test_sdk_path_is_none

 def test_sdk_path_is_none(self):
     with self.env() as sdk:
         with self.assertRaises(AndroidDistribution.DistributionError):
             AndroidDistribution.cached(sdk)
开发者ID:jduan,项目名称:pants,代码行数:4,代码来源:test_android_distribution.py


示例9: android_sdk

 def android_sdk(self):
   """Instantiate an Android SDK distribution that provides tools to android tasks."""
   return AndroidDistribution.cached(self._sdk_path)
开发者ID:MathewJennings,项目名称:pants,代码行数:3,代码来源:android_task.py


示例10: test_register_android_tool_bad_sdk

 def test_register_android_tool_bad_sdk(self):
   with self.assertRaises(AndroidDistribution.DistributionError):
     sdk = os.path.join('/no', 'sdk', 'here')
     android_sdk = AndroidDistribution.cached(sdk)
     aapt = os.path.join('build-tools', '19.1.0', 'aapt')
     android_sdk.register_android_tool(aapt)
开发者ID:dominichamon,项目名称:pants,代码行数:6,代码来源:test_android_distribution.py


示例11: test_validated_tools

 def test_validated_tools(self):
     with distribution() as sdk:
         android_sdk = AndroidDistribution.cached(sdk)
         aapt = os.path.join("build-tools", "19.1.0", "aapt")
         android_sdk.register_android_tool(aapt)
         self.assertIn(aapt, android_sdk._validated_tools)
开发者ID:jduan,项目名称:pants,代码行数:6,代码来源:test_android_distribution.py


示例12: test_register_nonexistent_android_tool

 def test_register_nonexistent_android_tool(self):
   with self.assertRaises(AndroidDistribution.DistributionError):
     with self.distribution() as sdk:
       android_sdk = AndroidDistribution.cached(sdk)
       android_sdk.register_android_tool(os.path.join('build-tools', '19.1.0', 'random_tool'))
开发者ID:dominichamon,项目名称:pants,代码行数:5,代码来源:test_android_distribution.py


示例13: test_empty_sdk_path

 def test_empty_sdk_path(self):
     # Shows that an AndroidDistribution can be created as long as an sdk path is declared.
     with temporary_dir() as sdk:
         android_sdk = AndroidDistribution.cached(sdk)
         self.assertEquals(android_sdk._sdk_path, sdk)
开发者ID:jduan,项目名称:pants,代码行数:5,代码来源:test_android_distribution.py


示例14: test_validated_tools

 def test_validated_tools(self):
   with self.distribution() as sdk:
     android_sdk = AndroidDistribution.cached(sdk)
     aapt = os.path.join('build-tools', '19.1.0', 'aapt')
     android_sdk.register_android_tool(aapt)
     self.assertIn(aapt, android_sdk._validated_tools)
开发者ID:dominichamon,项目名称:pants,代码行数:6,代码来源:test_android_distribution.py


示例15: test_locate_sdk_path

 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)
开发者ID:jduan,项目名称:pants,代码行数:5,代码来源:test_android_distribution.py


示例16: test_passing_sdk_path

 def test_passing_sdk_path(self):
     with distribution() as sdk:
         android_sdk = AndroidDistribution(sdk_path=sdk)
         aapt = os.path.join(sdk, "build-tools", "19.1.0", "aapt")
         android_tool = android_sdk.register_android_tool(aapt)
         self.assertEquals(android_tool, os.path.join(sdk, aapt))
开发者ID:jduan,项目名称:pants,代码行数:6,代码来源:test_android_distribution.py


示例17: test_locate_no_sdk_on_path

 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)
开发者ID:dominichamon,项目名称:pants,代码行数:6,代码来源:test_android_distribution.py


示例18: test_locate_no_sdk_on_path

 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()
开发者ID:jduan,项目名称:pants,代码行数:5,代码来源:test_android_distribution.py


示例19: test_validate_bad_path

 def test_validate_bad_path(self):
     # The SDK path is not validated until the tool is registered.
     sdk = os.path.join("/no", "sdk", "here")
     android_sdk = AndroidDistribution.cached(sdk)
     self.assertEquals(sdk, android_sdk._sdk_path)
开发者ID:jduan,项目名称:pants,代码行数:5,代码来源:test_android_distribution.py


示例20: test_locate_alternative_variables

 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)
开发者ID:jduan,项目名称:pants,代码行数:6,代码来源:test_android_distribution.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python Credential.Credential类代码示例发布时间:2022-05-27
下一篇:
Python db.session函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap