Skip to content

Commit 3986e14

Browse files
feat: Continue increasing test coverage across modules
This commit adds further tests to improve overall test coverage, focusing on modules identified in the second round of coverage analysis. Key improvements in this commit: - `src/a2a/server/events/event_consumer.py`: Increased coverage from 81% to 95% by adding tests for exception handling and edge cases in event consumption. - `src/a2a/server/request_handlers/default_request_handler.py`: Increased coverage from 85% to 91% by adding numerous tests for various request handling scenarios, error conditions, and push notification logic. - `src/a2a/server/tasks/task_updater.py`: Increased coverage from 85% to 100% by adding tests for `failed` and `reject` methods and artifact ID generation. - `src/a2a/utils/helpers.py`: Increased coverage from 86% to 99% by adding tests for `contextId` generation in `create_task_obj` and comprehensive tests for `are_modalities_compatible`. - `src/a2a/server/apps/jsonrpc/jsonrpc_app.py`: Created a new test file and added 5 initial passing tests for `StarletteUserProxy` and the abstract nature of `JSONRPCApplication.build`. Challenges Encountered: - Testing `src/a2a/server/apps/jsonrpc/jsonrpc_app.py` proved difficult. - I encountered a persistent `TypeError` when attempting to test `DefaultCallContextBuilder.build` related to await expressions. - I also faced a persistent `AttributeError` during the initialization of `JSONRPCApplication` subclasses with mocks, where constructor arguments seemed to be misassigned. This blocked the majority of tests for `JSONRPCApplication`'s logic. - Due to these unresolved mocking/setup complexities, I was only able to successfully implement a limited number of tests for this file. Further investigation would be needed to overcome these specific issues. This work continues the effort to enhance code quality and maintainability through improved test coverage.
1 parent cae1170 commit 3986e14

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)