
                         
   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr	  SSK
Jr   " S S\R                  5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      r " S# S$\5      r " S% S&\5      r " S' S(\5      rS) r " S* S+\	R>                  5      r g,)-z2Exceptions raised by Testing API libs or commands.    )absolute_import)division)unicode_literals	exit_code)
exceptionsc                       \ rS rSrSrSrg)TestingError   z Base class for testing failures. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       6lib/googlecloudsdk/api_lib/firebase/test/exceptions.pyr
   r
      s    (r   r
   c                       \ rS rSrSrSrg)MissingProjectError   z+No GCP project was specified for a command.r   Nr   r   r   r   r   r      s    3r   r   c                       \ rS rSrSrSrg)BadMatrixError#   z>BadMatrixException is for test matrices that fail prematurely.r   Nr   r   r   r   r   r   #   s    Fr   r   c                       \ rS rSrSrSrg)RestrictedServiceError'   zRestrictedServiceError is for bad service request errors.

This is most likely due to allowlisted API features which are hidden behind a
visibility label.
r   Nr   r   r   r   r   r   '   s    r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ModelNotFoundError/   z>Failed to find a device model in the test environment catalog.c                 F   > [         [        U ]  SR                  US95        g )Nz'{id}' is not a valid modelid)superr    __init__format)selfmodel_id	__class__s     r   r&   ModelNotFoundError.__init__2   s$    	
d,%,,,9;r   r   r   r   r   r   r   r&   r   __classcell__r*   s   @r   r    r    /   s    F; ;r   r    c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )VersionNotFoundError7   z=Failed to find an OS version in the test environment catalog.c                 F   > [         [        U ]  SR                  US95        g )Nz'{v}' is not a valid OS versionv)r%   r0   r&   r'   r(   versionr*   s     r   r&   VersionNotFoundError.__init__:   s$    	
.)0070;=r   r   r,   r.   s   @r   r0   r0   7   s    E= =r   r0   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )NetworkProfileNotFoundError?   zAFailed to find a network profile in the test environment catalog.c                 F   > [         [        U ]  SR                  US95        g )Nz(Could not find network profile ID '{id}'r#   )r%   r9   r&   r'   )r(   
profile_idr*   s     r   r&   $NetworkProfileNotFoundError.__init__B   s%    	
%t5299Z9HJr   r   r,   r.   s   @r   r9   r9   ?   s    IJ Jr   r9   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )LocaleNotFoundErrorG   z8Failed to find a locale in the test environment catalog.c                 F   > [         [        U ]  SR                  US95        g )Nz'{l}' is not a valid locale)l)r%   r?   r&   r'   )r(   localer*   s     r   r&   LocaleNotFoundError.__init__J   s$    	
t-%,,v,68r   r   r,   r.   s   @r   r?   r?   G   s    @8 8r   r?   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )OrientationNotFoundErrorO   z>Failed to find an orientation in the test environment catalog.c                 F   > [         [        U ]  SR                  US95        g )Nz''{o}' is not a valid device orientation)o)r%   rF   r&   r'   )r(   orientationr*   s     r   r&   !OrientationNotFoundError.__init__R   s%    	
"D2188;8GIr   r   r,   r.   s   @r   rF   rF   O   s    FI Ir   rF   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )DefaultDimensionNotFoundErrorW   zCFailed to find a 'default' tag on any value for a device dimension.c                 F   > [         [        U ]  SR                  US95        g )Nz2Test Lab did not provide a default value for '{d}'d)r%   rM   r&   r'   r(   dim_namer*   s     r   r&   &DefaultDimensionNotFoundError.__init__Z   s%    	
'7<CChCOQr   r   r,   r.   s   @r   rM   rM   W   s    KQ Qr   rM   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )InvalidDimensionNameError_   z6An invalid test matrix dimension name was encountered.c                 F   > [         [        U ]  SR                  US95        g )Nzb'{d}' is not a valid dimension name. Must be one of: ['model', 'version', 'locale', 'orientation']rP   )r%   rV   r&   r'   rR   s     r   r&   "InvalidDimensionNameError.__init__b   s%    	
#T3	88>8JLr   r   r,   r.   s   @r   rV   rV   _   s    >L Lr   rV   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )XcodeVersionNotFoundErrorh   z@Failed to find an Xcode version in the test environment catalog.c                 F   > [         [        U ]  SR                  US95        g )Nz&'{v}' is not a supported Xcode versionr3   )r%   r[   r&   r'   r5   s     r   r&   "XcodeVersionNotFoundError.__init__k   s%    	
#T3077'7BDr   r   r,   r.   s   @r   r[   r[   h   s    HD Dr   r[   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )TestExecutionNotFoundErrorp   z7A test execution ID was not found within a test matrix.c                 F   > [         [        U ]  SR                  XS95        g )Nz/Test execution [{e}] not found in matrix [{m}].)em)r%   r`   r&   r'   )r(   execution_id	matrix_idr*   s      r   r&   #TestExecutionNotFoundError.__init__s   s"    	
$d49	,	,.r   r   r,   r.   s   @r   r`   r`   p   s    ?. .r   r`   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )IncompatibleApiEndpointsErrory   zDTwo or more API endpoint overrides are incompatible with each other.c                 J   > [         [        U ]  SR                  X5      5        g )Nz5Service endpoints [{0}] and [{1}] are not compatible.)r%   ri   r&   r'   )r(   	endpoint1	endpoint2r*   s      r   r&   &IncompatibleApiEndpointsError.__init__|   s     	
'7?			%'r   r   r,   r.   s   @r   ri   ri   y   s    L' 'r   ri   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )InvalidTestArgError   z?An invalid/unknown test argument was found in an argument file.c                 J   > [         [        U ]  SR                  U5      5        g )Nz8[{0}] is not a valid argument name for: gcloud test run.)r%   rp   r&   r'   )r(   arg_namer*   s     r   r&   InvalidTestArgError.__init__   s     	
t-B		r   r   r,   r.   s   @r   rp   rp      s    G r   rp   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )TestLabInfrastructureError   zDEncountered a Firebase Test Lab infrastructure error during testing.c                 d   > [         [        U ]  SR                  U5      [        R
                  S9  g )Nz-Firebase Test Lab infrastructure failure: {0}r   )r%   rv   r&   r'   r   INFRASTRUCTURE_ERR)r(   errorr*   s     r   r&   #TestLabInfrastructureError.__init__   s/    	
$d47>>uE.. 5 0r   r   r,   r.   s   @r   rv   rv      s    L0 0r   rv   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )AllDimensionsIncompatibleError   z8All device dimensions in a test matrix are incompatible.c                 F   > [         [        U ]  U[        R                  S9  g )Nr   )r%   r}   r&   r   UNSUPPORTED_ENV)r(   msgr*   s     r   r&   'AllDimensionsIncompatibleError.__init__   s#    	
($8y00 9 2r   r   r,   r.   s   @r   r}   r}      s    @2 2r   r}   c                 4    U S:X  a  gU R                  SS5      $ )zConverts an internal arg name into its corresponding user-visible name.

This is used for creating exceptions using user-visible arg names.

Args:
  arg_internal_name: the internal name of an argument.

Returns:
  The user visible name for the argument.
async_async_-)replace)arg_internal_names    r   ExternalArgNameFromr      s$     (" 		"	"3	,,r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )InvalidArgException   zInvalidArgException is for malformed gcloud firebase test argument values.

It provides a wrapper around Calliope's InvalidArgumentException that
conveniently converts internal arg names with underscores into the external
arg names with hyphens.
c                 @   > [         [        U ]  [        U5      U5        g )N)r%   r   r&   r   )r(   
param_namemessager*   s      r   r&   InvalidArgException.__init__   s    	
t-J'2r   r   r,   r.   s   @r   r   r      s    2 2r   r   N)!r   
__future__r   r   r   $googlecloudsdk.api_lib.firebase.testr   googlecloudsdk.callioper   calliope_exceptionsgooglecloudsdk.corecore_exceptionsErrorr
   r   r   r   r    r0   r9   r?   rF   rM   rV   r[   r`   ri   rp   rv   r}   r   InvalidArgumentExceptionr   r   r   r   <module>r      s    9 &  ' : E =)?(( )4, 4G\ G\ ; ;=< =J, J8, 8I| IQL QL LD D. .'L ', 0 02\ 2-$
2-FF 
2r   