o
    iY                     @   s   d Z ddlmZ ddlZddlmZmZ ddlmZ ddlm	Z
 dd	lmZ ddlZejjejd
dddd Zejjejjejd
dddd Zejee g dZdS )z%Tests for Interactions API URL paths.    )mockN)RequestResponse   )AsyncHttpxClient)Client   )pytest_helperdefaultT)autospecc                 C   s  d}t  }d|_d|_d|_|df| _|jjr*d|jj d|jj	 d|jj }nd	}t j
td
}tdtddd|_|jj|d |  |jd d }t|j| d| ks^J |  tdtddd|_|jj|d |  |jd d }t|j| d| dksJ |  tdtddd|_|jj|d |  |jd d }t|j| d| ksJ W d    d S 1 sw   Y  d S Nztest-interaction-idz
test-tokenFztest-quota-projectztest-projectzhttps://z,-aiplatform.googleapis.com/v1beta1/projects/z/locations/z0https://generativelanguage.googleapis.com/v1betasend   GET )request)idr   z/interactions/POSTz/cancelDELETE)r   Mocktokenexpiredquota_project_idreturn_value_api_clientvertexailocationprojectpatchobject
HTTPClientr   r   interactionsgetassert_called_once	call_argsstrurl
reset_mockcanceldeletemock_auth_defaultclientinteraction_id
mock_credsexpected_base_url	mock_sendr    r1   h/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/google/genai/tests/interactions/test_paths.pytest_interactions_paths   s8   
$"r3   c                    s  d}t  }d|_d|_d|_|df| _|jjr+d|jj d|jj	 d|jj }nd	}t j
td
}tdtddd|_|jjj|dI d H  |  |jd d }t|j| d| kscJ |  tdtddd|_|jjj|dI d H  |  |jd d }t|j| d| dksJ |  tdtddd|_|jjj|dI d H  |  |jd d }t|j| d| ksJ W d    d S 1 sw   Y  d S r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   aior!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r1   r1   r2   test_async_interactions_paths@   s:   
$"r5   )fileglobals_for_file
test_table)__doc__unittestr   pytesthttpxr   r   r   r   r   r    r   r	   google.authgoogler   r   authr3   markasyncior5   setup__file__globals
pytestmarkr1   r1   r1   r2   <module>   s$   
##
