Back to Repositories

OpenHands Testing: Jest & Pytest Implementation for Full-Stack Applications

The OpenHands repository demonstrates a comprehensive testing approach utilizing both Jest and Pytest frameworks for thorough unit testing coverage. With over 100 test cases, the codebase showcases modern testing practices across frontend React components and backend Python modules, ensuring robust validation of core functionalities like prompt management, UI interactions, and terminal operations. Qodo Tests Hub provides developers with an organized view into OpenHands' testing patterns, making it easier to understand how different components are tested in a real-world application. Through the hub's interactive interface, developers can explore test implementations for specific features, analyze testing strategies for both frontend and backend components, and learn practical approaches to writing effective unit tests for similar applications.

Path Test Type Language Description
tests/unit/test_import_utils.py
unit
python This Python unit test verifies dynamic class implementation and abstract method verification in the import utilities module.
tests/unit/test_is_stuck.py
unit
python This pytest unit test verifies stuck detection logic and pattern recognition in the OpenHands agent controller
tests/unit/test_listen.py
unit
python This Python unit test verifies file upload configuration and extension validation functionality in the OpenHands server component.
tests/unit/test_llm.py
unit
python This pytest unit test suite verifies the initialization, configuration, and operation of the LLM class including completion handling, error management, and metrics tracking.
tests/unit/test_llm_fncall_converter.py
unit
python This pytest unit test verifies the conversion between function call and non-function call message formats in the OpenHands LLM framework.
tests/unit/test_prompt_caching.py
unit
python This pytest unit test verifies prompt caching behavior and message handling in the CodeActAgent component of OpenHands.
tests/unit/test_manager.py
unit
python This pytest unit test verifies SessionManager functionality for handling session initialization, joining, and event streaming in both local and clustered environments.
tests/unit/test_memory.py
unit
python This pytest unit test verifies the LongTermMemory component’s event processing, storage, and retrieval capabilities in the OpenHands framework.
tests/unit/test_micro_agents.py
unit
python This pytest unit test verifies the initialization and behavior of micro-agents in the OpenHands AI framework
tests/unit/test_microagent_utils.py
unit
python This pytest unit test verifies MicroAgent initialization and configuration handling in the OpenHands framework.