Beispiel #1
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))
Beispiel #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))
 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)
 def test_setup_keystore_config(self):
     with temporary_file() as config:
         AndroidConfigUtil.setup_keystore_config(config.name)
         self.assertEquals(config.read(), self.contents())
 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)
 def test_setup_keystore_config(self):
   with temporary_file() as config:
     AndroidConfigUtil.setup_keystore_config(config.name)
     self.assertEquals(config.read(), self.contents())