Skip to main content
Glama

MCP Weather Server

test_workflow.cpython-312-pytest-8.4.1.pyc6.93 kB
� ��hC ���ddlZddlmcmZddlZddlmZddl m Z m Z m Z m Z ejjed�d���Zy)�N)�patch)�geographic_tools�crop_calendar_tools� open_meteo�alert_generation_toolsz=src.mcp_weather_server.tools.openai_llm.predict_weather_alertc��B K�dddd�|_d}d}tj||���d{���}d}||v}|s�tjd |fd ||f�tj |�d t j�vstj|�rtj |�nd d �z}tjd |jd����dzd|iz}ttj|���dx}}|dd}tj|���d{���} d}|| v}|s�tjd |fd || f�tj |�dt j�vstj| �rtj | �ndd �z}tjd| jd����dzd|iz}ttj|���dx}}| d} | d} d} tj|| ���d{���} d}|| v}|s�tjd |fd || f�tj |�dt j�vstj| �rtj | �ndd �z}tjd| jd����dzd|iz}ttj|���dx}}| dd}d}d}tj |||���d{���}d}||v}|s�tjd |fd ||f�tj |�dt j�vstj|�rtj |�ndd �z}tjd |jd����dzd|iz}ttj|���dx}}|d!}t#j$| | �"��d{���}d}||v}|s�tjd |fd ||f�tj |�d#t j�vstj|�rtj |�nd#d �z}tjd$|jd����dzd|iz}ttj|���dx}}d%}t'j(||||| | �&��d{���}d}||u}|s�tjd'|fd(||f�d)t j�vstj|�rtj |�nd)tj |�d*�z}tjd+�dzd|iz}ttj|���dx}}d}||v}|s�tjd |fd ||f�tj |�d)t j�vstj|�rtj |�nd)d �z}tjd,|jd����dzd|iz}ttj|���dx}}t+d-|�y7��a7��q7��|7���7���7����w).NzHeavy rainfall expectedz$High risk of waterlogging in fields.z!Ensure proper drainage in fields.)�alert�impact�recommendations�bihar�Patna)�state�district�error)�not in)z%(py1)s not in %(py3)s�villages_response)�py1�py3zFailed to get villages: z >assert %(py5)s�py5�villagesr)� location_name�coordinates_responsezFailed to get coordinates: �latitude� longitude�Rabi)�region�season�prominent_crops_responsezFailed to get prominent crops: �cropsz 2023-11-01z 2024-02-15)�crop� plant_date� current_date�crop_stage_responsezFailed to estimate crop stage: �stage)rr�weather_forecast_responsez Failed to get weather forecast: � test_api_key)r � weather_data� growth_stage�api_keyrr)�is not)z%(py0)s is not %(py3)s�alert_response)�py0rzFailed to generate alertzAlert generation failed: zGenerated Alert:)� return_valuer� list_villages� @pytest_ar�_call_reprcompare� _saferepr� @py_builtins�locals�_should_repr_global_name�_format_assertmsg�get�AssertionError�_format_explanation�reverse_geocoder�get_prominent_crops�estimate_crop_stager�get_weather_forecastr�generate_weather_alert�print)�mock_predict_weather_alertrrr� @py_assert0� @py_assert2� @py_format4� @py_format6�villager�lat�lonrrr r!r"r#r(r%r)r+� @py_assert1s �/app/test_workflow.py�test_alert_generation_workflowrIs ���� +�8�>�/��+� �E��H�.�<�<�5�S[�\�\�� �h�7�+� +�h�h�h�7�+�h�h�h�7�h�h�h�h�h�h�+�h�h�h�+�h�h�h�h�/G�HY�H]�H]�^e�Hf�Gg�-h�h�h�h�h�h�h�� �+�A�.�G�!1�!A�!A�PW�!X�X�� �q�7�.� .�q�q�q�7�.�q�q�q�7�q�q�q�q�q�q�.�q�q�q�.�q�q�q�q�2M�Nb�Nf�Nf�gn�No�Mp�0q�q�q�q�q�q�q� �z� *�C� �{� +�C��F�%8�%L�%L�TY�bh�%i�i�� �}�7�2� 2�}�}�}�7�2�}�}�}�7�}�}�}�}�}�}�2�}�}�}�2�}�}�}�}�6U�Vn�Vr�Vr�sz�V{�U|�4}�}�}�}�}�}�}� #�G� ,�Q� /�D��J��L� 3� G� G�T�^h�xD�!E�E�� �s�7�-� -�s�s�s�7�-�s�s�s�7�s�s�s�s�s�s�-�s�s�s�-�s�s�s�s�1P�Qd�Qh�Qh�ip�Qq�Pr�/s�s�s�s�s�s�s�&�w�/�L�'1�&E�&E�s�^a�&b� b�� �A�7�3� 3�A�A�A�7�3�A�A�A�7�A�A�A�A�A�A�3�A�A�A�3�A�A�A�A�7W�Xq�Xu�Xu�v}�X~�W�6A�A�A�A�A�A�A��G�1�H�H�d�az�JV�`g�ru�AD�E�E�N�!%�A�>�� %�A�A�A�>��A�A�A�A�A�A�>�A�A�A�>�A�A�A��A�A�A�'A�A�A�A�A�A�A� �c�7�.� (�c�c�c�7�.�c�c�c�7�c�c�c�c�c�c�.�c�c�c�.�c�c�c�c�,E�n�FX�FX�Y`�Fa�Eb�*c�c�c�c�c�c�c� � �n�-�I]�� Y�� j��E�� !c�� E�so�*Z�Z �C2Z�Z� C7Z�Z�C8Z�Z�C0Z�Z�C1Z�3Z�4FZ�Z�Z�Z�Z�Z)�builtinsr2�_pytest.assertion.rewrite� assertion�rewriter/�pytest� unittest.mockr�src.mcp_weather_server.toolsrrrr�mark�asynciorI��rH�<module>rUs@���� ��r�r�������F�G�/.�H��/.rT

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