o
    i                     @   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)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_client r#   `/home/ubuntu/.local/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 )
NTaiohttp_clientFr   r   r   r   r   r   )	r   r   aiohttpClientSessionr   r   r   _aiohttp_sessionr	   r   r#   r#   r$   %test_constructor_with_aiohttp_clientsO   s"   r*   )__doc__asynciounittestr   google.oauth2r   r   pytest r   r   r   r'   AIOHTTP_NOT_INSTALLEDImportError	MagicMockmarkskipifrequires_aiohttpr%   r*   r#   r#   r#   r$   <module>   s2   %