test_server.cpython-312-pytest-8.4.1.pyc•11.7 kB
�
��h� � �l � d dl Zd dlmc mZ d dlZd dlmZ d dl m
Z
ee
� Zd� Zd� Z
d� Zd� Zd� Zy) � N)�
TestClient)�appc �� � d� }| j d|� t j ddddddd �d
��� }|j }d}||k( }|s�t j
d
|fd||f� dt
j � v st j |� rt j |� ndt j |� t j |� d�z }dd|iz }t t j |� � �d x}x}}d}|j } |� } || v }
|
s�t j
d|
fd|| f� t j |� dt
j � v st j |� rt j |� ndt j |� t j | � d�z }dd|iz }t t j |� � �d x}x}
x}} y )Nc � � K � ddiS �w�N�daily�mocked_forecast� ��args�kwargss �/app/test_server.py�mock_get_weather_forecastz<test_get_weather_forecast.<locals>.mock_get_weather_forecast � � �� ��*�+�+�� ��<src.mcp_weather_server.tools.open_meteo.get_weather_forecast�/mcp�get_weather_forecast�^K�=[D@���Mb�R�� F)�latitude� longitude�days�include_hourly��tool�
parameters��json�� ��==�z3%(py2)s
{%(py2)s = %(py0)s.status_code
} == %(py5)s�response��py0�py2�py5�assert %(py7)s�py7r ��in�zC%(py1)s in %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.json
}()
}��py1�py3r) r+ �assert %(py9)s�py9�
�setattr�client�post�status_code�
@pytest_ar�_call_reprcompare�@py_builtins�locals�_should_repr_global_name� _saferepr�AssertionError�_format_explanationr )�monkeypatchr r% �@py_assert1�@py_assert4�@py_assert3�@py_format6�@py_format8�@py_assert0�@py_assert6�@py_assert2�@py_format10s r �test_get_weather_forecastrK s9 � �,� ���V�Xq�r��{�{�6�&��!��#�
�)�{� �H� ���&�3�&��3�&�&�&�&��3�&�&�&�&�&�&�8�&�&�&�8�&�&�&��&�&�&�3�&�&�&�&�&�&�&��%�h�m�m�%�m�o�%�7�o�%�%�%�%�7�o�%�%�%�7�%�%�%�%�%�%�h�%�%�%�h�%�%�%�m�%�%�%�o�%�%�%�%�%�%�%� c �� � d� }| j d|� t j ddddd�d�� � }|j }d
}||k( }|s�t j
d|fd||f� d
t
j � v st j |� rt j |� nd
t j |� t j |� d�z }dd|iz }t t j |� � �d x}x}}d}|j } |� } || v }
|
s�t j
d|
fd|| f� t j |� d
t
j � v st j |� rt j |� nd
t j |� t j | � d�z }dd|iz }t t j |� � �d x}x}
x}} y )Nc � � K � ddiS �w)N�current_weather�mocked_weatherr
r s r �mock_get_current_weatherz:test_get_current_weather.<locals>.mock_get_current_weather s � �� �!�#3�4�4�r z;src.mcp_weather_server.tools.open_meteo.get_current_weatherr �get_current_weather���(\�BJ@�R����*@)r r r r r! r"