
    p[i                     \   d Z ddlZddlmZ ddlmZ ddlZddlZddlm	Z
 ddlmZ 	 ddlZdZej                   j#                  ed
      Zd Zeej                   j                  ej                   j#                  ed
      d                      Zy# e$ r d	Z ej                         ZY |w xY w)zTests for custom clients.    N)mock)credentials   )_api_client)ClientFTz(aiohttp is not installed, skipping test.)reasonc                     t        j                  d      t        j                  d      d} t        j                  d      t        j                  d      d}dt        _        t        d|       }|j
                  j                  j                  j                  rJ |j
                  j                  j                  j                  rJ |j
                  j                  j                         rJ t        ddd|	      }|j
                  j                  j                  j                  rJ |j
                  j                  j                  j                  rJ |j
                  j                  j                         rJ y )
NF	trust_env)httpx_clienthttpx_async_clientTgoogle_api_keyapi_keyhttp_optionsfake_project_idfake-locationvertexaiprojectlocationr   )httpxr   AsyncClient
api_clienthas_aiohttpmodelsr   _httpx_clientr   _async_httpx_client_use_aiohttpmldev_http_optionsvertexai_http_optionsmldev_clientvertexai_clients       e/mnt/data/GridWatch/venv/lib/python3.12/site-packages/google/genai/tests/client/test_custom_client.py#test_constructor_with_httpx_clientsr&   *   sC   llU3!-->
 llU3!-->  *-?,   ,,::DDD	D  ,,@@JJJ	J   ,,99;;	;(	/ ##//==GGG	G##//CCMMM	M   ,,99;;	;;    c                  j  K   dt         _        dt        j                  d      i} dt        j                  d      i}t	        d|       }|j
                  j                  j                  j                  rJ t	        ddd|	      }|j
                  j                  j                  j                  rJ y w)
NTaiohttp_clientFr
   r   r   r   r   r   )	r   r   aiohttpClientSessionr   r   r   _aiohttp_sessionr   r    s       r%   %test_constructor_with_aiohttp_clientsr-   O   s       *--> --> -?,   ,,==GGG	G(	/ ##//@@JJJ	JJs   B1B3)__doc__asynciounittestr   google.oauth2r   r   pytest r   r   r   r*   AIOHTTP_NOT_INSTALLEDImportError	MagicMockmarkskipifrequires_aiohttpr&   r-    r'   r%   <module>r;      s         %   ) 
 ;;%%"L &  !<J "L  K  
Ki  DNN's   B B+*B+