a
    !fJ                     @   s   d dl Z G dd de jZdS )    Nc                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestConnectionc                 C   s   ddl m} |S )Nr   )
Connection)Zgcloud.translate.connectionr   )selfr    r   a/var/www/html/python-backend/venv/lib/python3.9/site-packages/gcloud/translate/test_connection.py_getTargetClass   s    zTestConnection._getTargetClassc                 O   s   |   |i |S )N)r   )r   argskwr   r   r   _makeOne   s    zTestConnection._makeOnec                 C   s6   |   }d|jdd|jdg}| |d| d S )N/language	translatefoo/foo)r
   joinAPI_BASE_URLAPI_VERSIONassertEqualbuild_api_url)r   connURIr   r   r   (test_build_api_url_no_extra_query_params   s    z7TestConnection.test_build_api_url_no_extra_query_paramsc                 C   s   ddl m} ddl m} |  }ddg}|jd|d}||\}}}}	}
| d||f |j d	d
dd|jdg}| || ||	}| || d S )Nr   )	parse_qsl)urlsplit)qZval1)r   Zval2r   )query_paramsz%s://%sr    r   r   r   )	Zsix.moves.urllib.parser   r   r
   r   r   r   r   r   )r   r   r   r   r   urischemenetlocpathqs_Zexpected_pathparamsr   r   r   'test_build_api_url_w_extra_query_params&   s    z6TestConnection.test_build_api_url_w_extra_query_paramsN)__name__
__module____qualname__r   r
   r   r$   r   r   r   r   r      s   r   )Z	unittest2ZTestCaser   r   r   r   r   <module>   s   