예제 #1
0
파일: sign_apk.py 프로젝트: benjyw/pants
  def setup_default_config(cls, path):
    """Create the default keystore config file for Android targets.

    :param string path: Full path for the created default config file.
    """
    # TODO(mateor): Hook into pants global setup instead of relying on building an Android target.
    try:
      AndroidConfigUtil.setup_keystore_config(path)
    except AndroidConfigUtil.AndroidConfigError as e:
      raise TaskError('Failed to setup default keystore config: {0}'.format(e))
예제 #2
0
  def setup_default_config(cls, path):
    """Create the default keystore config file for Android targets.

    :param string path: Full path for the created default config file.
    """
    # TODO(mateor): Hook into pants global setup instead of relying on building an Android target.
    try:
      AndroidConfigUtil.setup_keystore_config(path)
    except AndroidConfigUtil.AndroidConfigError as e:
      raise TaskError('Failed to setup default keystore config: {0}'.format(e))
예제 #3
0
 def test_no_permission_keystore_config(self):
     with temporary_file() as temp:
         os.chmod(temp.name, 0o400)
         with self.assertRaises(AndroidConfigUtil.AndroidConfigError):
             AndroidConfigUtil.setup_keystore_config(temp.name)
예제 #4
0
 def test_setup_keystore_config(self):
     with temporary_file() as config:
         AndroidConfigUtil.setup_keystore_config(config.name)
         self.assertEquals(config.read(), self.contents())
예제 #5
0
 def test_no_permission_keystore_config(self):
   with temporary_file() as temp:
     os.chmod(temp.name, 0o400)
     with self.assertRaises(AndroidConfigUtil.AndroidConfigError):
       AndroidConfigUtil.setup_keystore_config(temp.name)
예제 #6
0
 def test_setup_keystore_config(self):
   with temporary_file() as config:
     AndroidConfigUtil.setup_keystore_config(config.name)
     self.assertEquals(config.read(), self.contents())