Skip to content

Conversation

@didier-durand
Copy link
Contributor

Description

As title says, this PR adds 24 tests for client/errors.py.

They all pass: see test execution capture on laptop below

Test execution

============================= test session starts ==============================
collecting ... collected 135 items

client/test_client.py::TestA2ACardResolver::test_init_strips_slashes PASSED [  0%]
client/test_client.py::TestA2ACardResolver::test_get_agent_card_success PASSED [  1%]
client/test_client.py::TestA2ACardResolver::test_get_agent_card_http_status_error PASSED [  2%]
client/test_client.py::TestA2ACardResolver::test_get_agent_card_json_decode_error PASSED [  2%]
client/test_client.py::TestA2ACardResolver::test_get_agent_card_request_error PASSED [  3%]
client/test_client.py::TestA2AClient::test_init_with_agent_card PASSED   [  4%]
client/test_client.py::TestA2AClient::test_init_with_url PASSED          [  5%]
client/test_client.py::TestA2AClient::test_init_with_agent_card_and_url_prioritizes_agent_card PASSED [  5%]
client/test_client.py::TestA2AClient::test_init_raises_value_error_if_no_card_or_url PASSED [  6%]
client/test_client.py::TestA2AClient::test_get_client_from_agent_card_url_success PASSED [  7%]
client/test_client.py::TestA2AClient::test_get_client_from_agent_card_url_resolver_error PASSED [  8%]
client/test_client.py::TestA2AClient::test_send_message_success_use_request PASSED [  8%]
client/test_client.py::TestA2AClient::test_send_message_error_response PASSED [  9%]
client/test_client.py::TestA2AClient::test_send_message_streaming_success_request PASSED [ 10%]
client/test_client.py::TestA2AClient::test_get_task_success_use_request PASSED [ 11%]
client/test_client.py::TestA2AClient::test_get_task_error_response PASSED [ 11%]
client/test_client.py::TestA2AClient::test_cancel_task_success_use_request PASSED [ 12%]
client/test_client.py::TestA2AClient::test_cancel_task_error_response PASSED [ 13%]
client/test_errors.py::TestA2AClientError::test_instantiation PASSED     [ 14%]
client/test_errors.py::TestA2AClientError::test_inheritance PASSED       [ 14%]
client/test_errors.py::TestA2AClientHTTPError::test_instantiation PASSED [ 15%]
client/test_errors.py::TestA2AClientHTTPError::test_message_formatting PASSED [ 16%]
client/test_errors.py::TestA2AClientHTTPError::test_inheritance PASSED   [ 17%]
client/test_errors.py::TestA2AClientHTTPError::test_with_empty_message PASSED [ 17%]
client/test_errors.py::TestA2AClientHTTPError::test_with_various_status_codes PASSED [ 18%]
client/test_errors.py::TestA2AClientJSONError::test_instantiation PASSED [ 19%]
client/test_errors.py::TestA2AClientJSONError::test_message_formatting PASSED [ 20%]
client/test_errors.py::TestA2AClientJSONError::test_inheritance PASSED   [ 20%]
client/test_errors.py::TestA2AClientJSONError::test_with_empty_message PASSED [ 21%]
client/test_errors.py::TestA2AClientJSONError::test_with_various_messages PASSED [ 22%]
client/test_errors.py::TestExceptionHierarchy::test_exception_hierarchy PASSED [ 22%]
client/test_errors.py::TestExceptionHierarchy::test_catch_specific_exception PASSED [ 23%]
client/test_errors.py::TestExceptionHierarchy::test_catch_base_exception PASSED [ 24%]
client/test_errors.py::TestExceptionRaising::test_raising_http_error PASSED [ 25%]
client/test_errors.py::TestExceptionRaising::test_raising_json_error PASSED [ 25%]
client/test_errors.py::TestExceptionRaising::test_raising_base_error PASSED [ 26%]
client/test_errors.py::test_http_error_parametrized[400-Bad Request-HTTP Error 400: Bad Request] PASSED [ 27%]
client/test_errors.py::test_http_error_parametrized[404-Not Found-HTTP Error 404: Not Found] PASSED [ 28%]
client/test_errors.py::test_http_error_parametrized[500-Server Error-HTTP Error 500: Server Error] PASSED [ 28%]
client/test_errors.py::test_json_error_parametrized[Missing field-JSON Error: Missing field] PASSED [ 29%]
client/test_errors.py::test_json_error_parametrized[Invalid type-JSON Error: Invalid type] PASSED [ 30%]
client/test_errors.py::test_json_error_parametrized[Parsing failed-JSON Error: Parsing failed] PASSED [ 31%]
server/events/test_event_consumer.py::test_consume_one_task_event PASSED [ 31%]
server/events/test_event_consumer.py::test_consume_one_message_event PASSED [ 32%]
server/events/test_event_consumer.py::test_consume_one_a2a_error_event PASSED [ 33%]
server/events/test_event_consumer.py::test_consume_one_jsonrpc_error_event PASSED [ 34%]
server/events/test_event_consumer.py::test_consume_one_queue_empty PASSED [ 34%]
server/events/test_event_consumer.py::test_consume_all_multiple_events PASSED [ 35%]
server/events/test_event_consumer.py::test_consume_until_message PASSED  [ 36%]
server/events/test_event_consumer.py::test_consume_message_events PASSED [ 37%]
server/events/test_event_queue.py::test_enqueue_and_dequeue_event PASSED [ 37%]
server/events/test_event_queue.py::test_dequeue_event_no_wait PASSED     [ 38%]
server/events/test_event_queue.py::test_dequeue_event_empty_queue_no_wait PASSED [ 39%]
server/events/test_event_queue.py::test_dequeue_event_wait PASSED        [ 40%]
server/events/test_event_queue.py::test_task_done PASSED                 [ 40%]
server/events/test_event_queue.py::test_enqueue_different_event_types PASSED [ 41%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_cancel_task_not_found PASSED [ 42%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_cancel_task_not_supported PASSED [ 42%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_cancel_task_success PASSED [ 43%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_get_task_not_found PASSED [ 44%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_get_task_success PASSED [ 45%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_message_error PASSED [ 45%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_message_new_message_success PASSED [ 46%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_message_new_message_with_existing_task_success PASSED [ 47%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_message_stream_new_message_existing_task_success PASSED [ 48%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_message_stream_new_message_success PASSED [ 48%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_resubscribe_existing_task_success PASSED [ 49%]
server/request_handlers/test_jsonrpc_handler.py::TestJSONRPCtHandler::test_on_resubscribe_no_existing_task_error PASSED [ 50%]
server/tasks/test_inmemory_task_store.py::test_in_memory_task_store_save_and_get PASSED [ 51%]
server/tasks/test_inmemory_task_store.py::test_in_memory_task_store_get_nonexistent PASSED [ 51%]
server/tasks/test_inmemory_task_store.py::test_in_memory_task_store_delete PASSED [ 52%]
server/tasks/test_inmemory_task_store.py::test_in_memory_task_store_delete_nonexistent PASSED [ 53%]
server/tasks/test_task_manager.py::test_get_task_existing PASSED         [ 54%]
server/tasks/test_task_manager.py::test_get_task_nonexistent PASSED      [ 54%]
server/tasks/test_task_manager.py::test_save_task_event_new_task PASSED  [ 55%]
server/tasks/test_task_manager.py::test_save_task_event_status_update PASSED [ 56%]
server/tasks/test_task_manager.py::test_save_task_event_artifact_update PASSED [ 57%]
server/tasks/test_task_manager.py::test_ensure_task_existing PASSED      [ 57%]
server/tasks/test_task_manager.py::test_ensure_task_nonexistent PASSED   [ 58%]
server/tasks/test_task_manager.py::test_init_task_obj PASSED             [ 59%]
server/tasks/test_task_manager.py::test_save_task PASSED                 [ 60%]
server/tasks/test_task_manager.py::test_save_task_event_new_task_no_task_id PASSED [ 60%]
server/tasks/test_task_manager.py::test_get_task_no_task_id PASSED       [ 61%]
server/tasks/test_task_manager.py::test_save_task_event_no_task_existing PASSED [ 62%]
test_types.py::test_agent_authentication_valid PASSED                    [ 62%]
test_types.py::test_agent_authentication_invalid PASSED                  [ 63%]
test_types.py::test_agent_capabilities PASSED                            [ 64%]
test_types.py::test_agent_provider PASSED                                [ 65%]
test_types.py::test_agent_skill_valid PASSED                             [ 65%]
test_types.py::test_agent_skill_invalid PASSED                           [ 66%]
test_types.py::test_agent_card_valid PASSED                              [ 67%]
test_types.py::test_agent_card_invalid PASSED                            [ 68%]
test_types.py::test_text_part PASSED                                     [ 68%]
test_types.py::test_file_part_variants PASSED                            [ 69%]
test_types.py::test_data_part PASSED                                     [ 70%]
test_types.py::test_part_root_model PASSED                               [ 71%]
test_types.py::test_message PASSED                                       [ 71%]
test_types.py::test_task_status PASSED                                   [ 72%]
test_types.py::test_task PASSED                                          [ 73%]
test_types.py::test_jsonrpc_error PASSED                                 [ 74%]
test_types.py::test_jsonrpc_request PASSED                               [ 74%]
test_types.py::test_jsonrpc_error_response PASSED                        [ 75%]
test_types.py::test_jsonrpc_response_root_model PASSED                   [ 76%]
test_types.py::test_send_message_request PASSED                          [ 77%]
test_types.py::test_send_subscribe_request PASSED                        [ 77%]
test_types.py::test_get_task_request PASSED                              [ 78%]
test_types.py::test_cancel_task_request PASSED                           [ 79%]
test_types.py::test_get_task_response PASSED                             [ 80%]
test_types.py::test_send_message_response PASSED                         [ 80%]
test_types.py::test_cancel_task_response PASSED                          [ 81%]
test_types.py::test_send_message_streaming_status_update_response PASSED [ 82%]
test_types.py::test_send_message_streaming_artifact_update_response PASSED [ 82%]
test_types.py::test_set_task_push_notification_response PASSED           [ 83%]
test_types.py::test_get_task_push_notification_response PASSED           [ 84%]
test_types.py::test_a2a_request_root_model PASSED                        [ 85%]
test_types.py::test_content_type_not_supported_error PASSED              [ 85%]
test_types.py::test_task_not_found_error PASSED                          [ 86%]
test_types.py::test_push_notification_not_supported_error PASSED         [ 87%]
test_types.py::test_internal_error PASSED                                [ 88%]
test_types.py::test_invalid_params_error PASSED                          [ 88%]
test_types.py::test_invalid_request_error PASSED                         [ 89%]
test_types.py::test_json_parse_error PASSED                              [ 90%]
test_types.py::test_method_not_found_error PASSED                        [ 91%]
test_types.py::test_task_not_cancelable_error PASSED                     [ 91%]
test_types.py::test_unsupported_operation_error PASSED                   [ 92%]
test_types.py::test_task_id_params_valid PASSED                          [ 93%]
test_types.py::test_task_id_params_invalid PASSED                        [ 94%]
test_types.py::test_task_push_notification_config PASSED                 [ 94%]
test_types.py::test_jsonrpc_message_valid PASSED                         [ 95%]
test_types.py::test_jsonrpc_message_invalid PASSED                       [ 96%]
test_types.py::test_file_base_valid PASSED                               [ 97%]
test_types.py::test_file_base_invalid PASSED                             [ 97%]
test_types.py::test_part_base_valid PASSED                               [ 98%]
test_types.py::test_part_base_invalid PASSED                             [ 99%]
test_types.py::test_a2a_error_validation_and_serialization PASSED        [100%]

@didier-durand didier-durand requested a review from a team as a code owner May 15, 2025 03:55
@holtskinner holtskinner merged commit ff18ce3 into a2aproject:main May 19, 2025
5 checks passed
@didier-durand
Copy link
Contributor Author

Thanks for merging this PR.
Didier

martimfasantos pushed a commit to martimfasantos/a2a-python that referenced this pull request May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants