
    hj                         d dl mZ ddlmZ d dlZddlmZ dZ	d Z
ej        j        d             Zej                            d	          d
             Zej                            d	          d             ZdS )    )mock   )google_genaiN)client)pytest_asyncioc            
         t           j                            t          dd          5 } t          j                    }|| _        t          j        dddd          }|j        j	        }| 
                    t           j        t           j        t           j        t           j        t           j        dt           j        	           d d d            d S # 1 swxY w Y   d S )
NGenAITspec_setplaceholderv1alpha  api_versiontimeoutapi_keyhttp_options)securityr   user_project
server_urlr   
timeout_msretry_config)r   patchobjectgaos_google_genaiMockreturn_value
client_libClientinteractionswith_raw_responseassert_called_once_withANY)
mock_genaimock_clientr   _s       t/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/google/genai/tests/interactions/test_integration.pytest_client_timeoutr)      s   z4    )++K)J%.4@@  F 	-A&&HX8xX '                    s   BCCCc            
        K   t           j                            t          dd          5 } t          j                    }|| _        t          j        dddd          }|j        j	        j
        }|                     t           j        t           j        t           j        t           j        t           j        dt           j        	           d d d            d S # 1 swxY w Y   d S )
N
AsyncGenAITr
   r   r   r   r   r   )r   r   r   r   async_clientr   r   )r   r   r   r   r   r   r   r    aior!   r"   r#   r$   )mock_async_genair&   r   r'   s       r(   test_async_client_timeoutr/   5   s     z    )++K$/!%.4@@  F 	
1A,,HX8XX -                    s   BCCCerrorc                  p    ddl m}   | dd          }|                                }|d         dk    sJ d S )Nr   CreateModelInteractiongemini-3.5-flashhellomodelinputr7   )/_gaos.types.interactions.createmodelinteractionr3   
model_dump)r3   objdumpeds      r(   %test_unrecognized_model_serializationr=   P   sU    WWWWWW%7wGGG#>>&	.	.	.	.	.	.	.    c                      ddl m}  ddlm}  |dd          } | |          }|                                }|d         d	         dk    sJ d S )
Nr   )CreateInteractionRequestr2   r4   r5   r6   )bodyrA   r7   )_gaos.models.createinteractionr@   r9   r3   r:   )r@   r3   rA   reqr<   s        r(   -test_unrecognized_model_request_serializationrD   Y   s    HHHHHHWWWWWW		&8	H	H	H$  d+++#>>&		 $6	6	6	6	6	6	6r>   )unittestr   _gaosr   r   pytest r   r   pytest_pluginsr)   markasyncior/   filterwarningsr=   rD    r>   r(   <module>rN      s          6 6 6 6 6 6  $ $ $ $ $ $ %  4   4 G$$/ / %$/ G$$7 7 %$7 7 7r>   