示例#1
0
  def Run(self, args):
    """Run the 'gcloud firebase test ios versions describe' command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation (i.e. group and command arguments combined).

    Returns:
      The testing_v1_messages.IosVersion object to describe.
    """
    catalog = util.GetIosCatalog(self.context)
    for version in catalog.versions:
      if version.id == args.version_id:
        return version
    raise exceptions.VersionNotFoundError(args.version_id)
示例#2
0
 def ValidateDimensionAndValue(self, dim_name, dim_value):
     """Validates that a matrix dimension has a valid name and value."""
     if dim_name == _MODEL_DIMENSION:
         if dim_value not in self._model_ids:
             raise exceptions.ModelNotFoundError(dim_value)
     elif dim_name == _VERSION_DIMENSION:
         if dim_value not in self._version_ids:
             raise exceptions.VersionNotFoundError(dim_value)
     elif dim_name == _LOCALE_DIMENSION:
         if dim_value not in self._locale_ids:
             raise exceptions.LocaleNotFoundError(dim_value)
     elif dim_name == _ORIENTATION_DIMENSION:
         if dim_value not in self._orientation_ids:
             raise exceptions.OrientationNotFoundError(dim_value)
     else:
         raise exceptions.InvalidDimensionNameError(dim_name)
     return dim_value
 def ValidateDimensionAndValue(self, dim_name, dim_value):
     """Validates that a matrix dimension has a valid name and value."""
     if dim_name == 'model':
         if dim_value not in self._model_ids:
             raise exceptions.ModelNotFoundError(dim_value)
     elif dim_name == 'version':
         if dim_value not in self._version_ids:
             raise exceptions.VersionNotFoundError(dim_value)
     # TODO(b/78015882): add proper support for locales and orientations
     # elif dim_name == 'locale':
     #   if dim_value not in self._locale_ids:
     #     raise exceptions.LocaleNotFoundError(dim_value)
     # elif dim_name == 'orientation':
     #   if dim_value not in self._orientation_ids:
     #     raise exceptions.OrientationNotFoundError(dim_value)
     else:
         raise exceptions.InvalidIosDimensionNameError(dim_name)
     return dim_value
 def ValidateDimensionAndValue(self, dim_name, dim_value):
     """Validates that a matrix dimension has a valid name and value."""
     if dim_name == 'model':
         if dim_value not in self._model_ids:
             raise exceptions.ModelNotFoundError(dim_value)
     elif dim_name == 'locale':
         if dim_value not in self._locale_ids:
             raise exceptions.LocaleNotFoundError(dim_value)
     elif dim_name == 'orientation':
         if dim_value not in self._orientation_ids:
             raise exceptions.OrientationNotFoundError(dim_value)
     elif dim_name == 'version':
         if dim_value not in self._version_ids:
             # Users are allowed to specify either version name or version ID.
             version_id = self._version_name_to_id.get(dim_value, None)
             if not version_id:
                 raise exceptions.VersionNotFoundError(dim_value)
             return version_id
     else:
         raise exceptions.InvalidDimensionNameError(dim_name)
     return dim_value