test: Add unit test for pydumpling/rpdb.py
Trigger Info
| Trigger Type | Triggered By | Source File | Assignment |
|---|---|---|---|
| Manual | cocolato | pydumpling/rpdb.py | Detail |
Summary
This PR introduces comprehensive unit tests for the pydumpling.rpdb module, ensuring robust coverage and validation of its functionality. The key additions and changes include:
-
Tests for
FileObjectWrapper:-
Validation of attribute access from both the wrapped file object and the standard I/O object.
-
Handling of
AttributeErrorfor non-existent attributes.
-
-
Tests for
Rpdb:-
Initialization tests to verify socket setup, binding, and acceptance of connections.
-
Tests for shutdown behavior, ensuring proper cleanup of resources.
-
Tests for debugger commands (
do_continue,do_quit,do_EOF) to confirm correct behavior and resource cleanup.
-
-
Tests for
OccupiedPorts:-
Validation of port claiming and unclaiming functionality.
-
Ensuring thread safety when multiple threads interact with the
OccupiedPortsinstance.
-
-
Tests for
r_post_mortem:-
Verification of debugger interaction with a loaded dump file.
-
Support for custom address and port configurations.
-
These tests utilize pytest and extensive mocking to simulate various scenarios, ensuring the module's reliability and correctness.
[!TIP] You can
@gru-agentand leave your feedback. TestGru will make adjustments based on your input
[!TIP] You can
@gru-agent rebaseto rebase the PR.
[!TIP] You can
@gru-agent redoto reset or rebase before redoing the PR.
[!TIP] To modify the test code yourself, click here Edit Test Code