o
    Yi                     @   s   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 zddlZdZW n ey=   d	Ze ZY nw ejjed
dZdd Zeejjejjed
ddd ZdS )zTests for custom clients.    N)mock)credentials   )_api_client)ClientFTz(aiohttp is not installed, skipping test.)reasonc                  C   s   t jddt jddd} t jddt jddd}dt_td| d}|jjjjr+J |jjj	jr3J |jj
 r;J tddd|d	}|jjjjrKJ |jjj	jrSJ |jj
 r[J d S )
NF	trust_env)Zhttpx_clientZhttpx_async_clientTgoogle_api_keyZapi_keyhttp_optionsfake_project_idfake-locationZvertexaiprojectlocationr   )httpxr   ZAsyncClient
api_clienthas_aiohttpmodelsr   Z_httpx_clientr	   Z_async_httpx_clientZ_use_aiohttpZmldev_http_optionsZvertexai_http_optionsZmldev_clientZvertexai_client r   f/home/kim/smarthome/.venv/lib/python3.10/site-packages/google/genai/tests/client/test_custom_client.py#test_constructor_with_httpx_clients*   s,   



r   c                     sh   dt _dtjddi} dtjddi}td| d}|jjjjr"J tddd|d	}|jjjjr2J d S )
NTZaiohttp_clientFr   r
   r   r   r   r   )	r   r   aiohttpZClientSessionr   r   r   Z_aiohttp_sessionr	   r   r   r   r   %test_constructor_with_aiohttp_clientsO   s"   r   )__doc__ZasyncioZunittestr   Zgoogle.oauth2r   r   Zpytest r   r   r   r   ZAIOHTTP_NOT_INSTALLEDImportErrorZ	MagicMockmarkZskipifZrequires_aiohttpr   r   r   r   r   r   <module>   s2   %