Skip to main content
Glama

MCP Weather Server

test_new_tools.cpython-312-pytest-8.4.1.pyc11.5 kB
� l�h��x�ddlZddlmcmZddlZddlmZddl m Z ee �Z d�Z d�Z d�Zd�Zd�Zd �Zd �Zy) �N)� TestClient)�appc��tjddddid���}|j}d}||k(}|s�tjd|fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}d d |iz}ttj|���dx}x}}|j}|�}dgd�i}||k(}|s�tjd|fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)N�/mcp� list_villages�state�bihar��tool� parameters��json����==�z3%(py2)s {%(py2)s = %(py0)s.status_code } == %(py5)s�response��py0�py2�py5�assert %(py7)s�py7� districts)�Patna�Gaya� Muzaffarpur�zC%(py4)s {%(py4)s = %(py2)s {%(py2)s = %(py0)s.json }() } == %(py7)s�rr�py4r�assert %(py9)s�py9� �client�post� status_code� @pytest_ar�_call_reprcompare� @py_builtins�locals�_should_repr_global_name� _saferepr�AssertionError�_format_explanationr� r� @py_assert1� @py_assert4� @py_assert3� @py_format6� @py_format8� @py_assert6� @py_assert5� @py_format10s �/app/test_new_tools.py�test_list_villagesr9s���{�{�6��QX�Za�Pb�(c�{�d�H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�M�=�?�M�{�,L�M�M�?�M� M�M�M�M�?�M�M�M�M�M�M�M�8�M�M�M�8�M�M�M�=�M�M�M�?�M�M�M�M�M�M�M�M�M�M�M�c��tjddddid���}|j}d}||k(}|s�tjd|fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}d d |iz}ttj|���dx}x}}|j}|�}ddd�}||k(}|s�tjd|fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)Nr�reverse_geocode� location_name�patnar r rrrrrrr繍��9@��:p�HU@)�latitude� longituderrr!r"r#r/s r8�test_reverse_geocoderC s���{�{�6�1B�Sb�dk�Rl�(m�{�n�H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�I�=�?�I�7��I�I�?�I� I�I�I�I�?�I�I�I�I�I�I�I�8�I�I�I�8�I�I�I�=�I�I�I�?�I�I�I�I�I�I�I�I�I�I�Ir:c��tjddddid���}|j}d}||k(}|s�tjd|fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}d d |iz}ttj|���dx}x}}|j}|�}dddgddgddgddgddgggd�}||k(}|s�tjd|fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)Nr�get_administrative_bounds� village_idr>r r rrrrrrr�Polygong@U@g�9@g�����LU@g33333�9@)�type� coordinatesrrr!r"r#r/s r8�test_get_administrative_boundsrJs����{�{�6�1L�]i�kr�\s�(t�{�u�H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�K�=�?�K�y�D�$�<�RV�X\�Q]�`d�fj�_k�nr�tx�my�}A�CG�|H�CI�BJ�K�K�?�K� K�K�K�K�?�K�K�K�K�K�K�K�8�K�K�K�8�K�K�K�=�K�K�K�?�K�K�K�K�K�K�K�K�K�K�Kr:c��tjddddid���}|j}d}||k(}|s�tjd|fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}d d |iz}ttj|���dx}x}}|j}|�}dgd�i}||k(}|s�tjd|fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)Nr�get_crop_calendar�regionr r r rrrrrrr�crops)�rice�wheat�maizerrr!r"r#r/s r8�test_get_crop_calendarrRs���{�{�6�1D�U]�_f�Tg�(h�{�i�H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�C�=�?�C�w�(B�C�C�?�C� C�C�C�C�?�C�C�C�C�C�C�C�8�C�C�C�8�C�C�C�=�C�C�C�?�C�C�C�C�C�C�C�C�C�C�Cr:c��tjddddd�d���}|j}d}||k(}|s�tjd |fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}d d|iz}ttj|���dx}x}}|j}|�}dddgi}||k(}|s�tjd |fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)Nr�get_prominent_cropsr �kharif)rM�seasonr r rrrrrrrrNrOrQrrr!r"r#r/s r8�test_get_prominent_cropsrWs���{�{�6�1F�ah�t|�V}�(~�{��H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�:�=�?�:�w���(9�:�:�?�:� :�:�:�:�?�:�:�:�:�:�:�:�8�:�:�:�8�:�:�:�=�:�:�:�?�:�:�:�:�:�:�:�:�:�:�:r:c��tjdddddd�d���}|j}d }||k(}|s�tjd |fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}dd|iz}ttj|���dx}x}}|j}|�}ddi}||k(}|s�tjd |fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)Nr�estimate_crop_stagerOz 2023-06-01z 2023-07-01)�crop� plant_date� current_dater r rrrrrrr�stage� vegetativerrr!r"r#r/s r8�test_estimate_crop_stager_ s/���{�{�6�1F�_e�vB�T`�Wa�)b�{�c�H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�5�=�?�5�w� �5�5�?�5� 5�5�5�5�?�5�5�5�5�5�5�5�8�5�5�5�8�5�5�5�=�5�5�5�?�5�5�5�5�5�5�5�5�5�5�5r:c��tjdddddd�d���}|j}d }||k(}|s�tjd |fd ||f�d t j �vstj|�rtj|�nd tj|�tj|�d �z}dd|iz}ttj|���dx}x}}|j}|�}ddd�}||k(}|s�tjd |fd||f�d t j �vstj|�rtj|�nd tj|�tj|�tj|�d�z}dd|iz}ttj|���dx}x}x}}y)Nr�analyze_weather_trendsr?r@z7-day)rArB�periodr r rrrrrrr�clearg�������?)�trend� confidencerrr!r"r#r/s r8�test_analyze_weather_trendsrf%s/���{�{�6�1I�fm�}D�PW�ZX�)Y�{�Z�H� � � �&�3�&� �3� &�&�&�&� �3�&�&�&�&�&�&�8�&�&�&�8�&�&�&� �&�&�&�3�&�&�&�&�&�&�&� �=�=�C�=�?�C��s�C�C�?�C� C�C�C�C�?�C�C�C�C�C�C�C�8�C�C�C�8�C�C�C�=�C�C�C�?�C�C�C�C�C�C�C�C�C�C�Cr:)�builtinsr)�_pytest.assertion.rewrite� assertion�rewriter'�pytest�fastapi.testclientr�src.mcp_weather_server.serverrr$r9rCrJrRrWr_rf�r:r8�<module>rosC���� �)�-� �C���N� J� K� D� ;� 6� Dr:

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/digitalgreenorg/AgMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server