pyvider
2025-05-24
Focused fix-up of the pyvider-rpcplugin test suite, addressing multiple test failures across...
16 files · 470+ · 325-
RPC Plugin Client Test Fixes
8 files changed
test_client_grpc.py`test_client_grpc.py`: Fixed Unix socket channel test to use `AsyncMock(spec=UnixSocketTransport)...test_client_handshake.py`test_client_handshake.py`: Rewrote all handshake tests (~118 lines changed) to use `patch('pyvid...test_client_init.py`test_client_init.py`: Updated ~80 lines, improving initialization test patternstest_client_lifecycle.py`test_client_lifecycle.py`: Expanded by ~139 lines with additional lifecycle test coverage, impro...test_client_stubs.py`test_client_stubs.py`: Expanded by ~106 lines, improving stub method test coverage and mock patt...test_client_transport.py`test_client_transport.py`: Updated ~32 lines of transport-related teststest_client_integration.py`test_client_integration.py`: Minor adjustments to integration test setuptest_connection.py`test_connection.py`: Simplified by ~111 lines, removing redundant connection management tests
test_client_grpc.py: Fixed Unix socket channel test to useAsyncMock(spec=UnixSocketTransport)instead of bareMagicMock(), corrected the channel creation assertion to not expect extraANYarguments, added proper import forUnixSocketTransportqualify internal1 file
test_client_grpc.py
test_client_handshake.py: Rewrote all handshake tests (~118 lines changed) to usepatch('pyvider.rpcplugin.client.base.RPCPluginClient._relay_stderr_background', new_callable=AsyncMock)instead ofpatch.object(client_instance, ...), consolidated nestedwithblocks into single multi-context-managerwithstatements, added assertions verifyingmock_relay.assert_called_once()and thatclient_instance._transport is mock_transport_instance, fixed the process exit test to set bothmock_process.poll.return_valueandmock_process.returncodequalify internal1 file
test_client_handshake.py
test_client_init.py: Updated ~80 lines, improving initialization test patterns qualify internal1 file
test_client_init.py
test_client_lifecycle.py: Expanded by ~139 lines with additional lifecycle test coverage, improving start/stop and connection management test scenarios qualify internal1 file
test_client_lifecycle.py
test_client_stubs.py: Expanded by ~106 lines, improving stub method test coverage and mock patterns qualify internal1 file
test_client_stubs.py
test_client_transport.py: Updated ~32 lines of transport-related tests qualify internal1 file
test_client_transport.py
test_client_integration.py: Minor adjustments to integration test setup qualify internal1 file
test_client_integration.py
test_connection.py: Simplified by ~111 lines, removing redundant connection management tests qualify internal1 file
test_connection.py
Crypto Certificate Test Fixes
4 files changed
test_certificate_chains.py`test_certificate_chains.py`: Minor chain validation test adjustmentstest_certificate_create.py`test_certificate_create.py`: Updated ~29 lines of certificate creation teststest_certificate_lifecycle.py`test_certificate_lifecycle.py`: Updated ~22 lines of certificate lifecycle teststest_certificate_loading.py`test_certificate_loading.py`: Simplified certificate loading test assertions
test_certificate_chains.py: Minor chain validation test adjustments qualify internal1 file
test_certificate_chains.py
test_certificate_create.py: Updated ~29 lines of certificate creation tests qualify internal1 file
test_certificate_create.py
test_certificate_lifecycle.py: Updated ~22 lines of certificate lifecycle tests qualify internal1 file
test_certificate_lifecycle.py
test_certificate_loading.py: Simplified certificate loading test assertions qualify internal1 file
test_certificate_loading.py
RPC Plugin Source Changes
2 files changed
base.py`client/base.py`: Updated ~29 lines in the base client, likely adjusting method signatures or int...certificate.py`crypto/certificate.py`: Updated ~68 lines in the certificate module, improving certificate handl...
client/base.py: Updated ~29 lines in the base client, likely adjusting method signatures or internal logic to align with test expectations qualify internal1 file
base.py
crypto/certificate.py: Updated ~68 lines in the certificate module, improving certificate handling to match corrected test expectations qualify internal1 file
certificate.py
Environment and Configuration
3 files changed
env.sh`pyvider-rpcplugin/env.sh`: Fixed `ENV_SCRIPT_DIR` to use `BASH_SOURCE[0]` instead of `$0` for re...uv sync`pyvider-rpcplugin/env.sh`: Fixed `ENV_SCRIPT_DIR` to use `BASH_SOURCE[0]` instead of `$0` for re...pyproject.toml`pyvider-telemetry/pyproject.toml`: Dependency version adjustments
pyvider-rpcplugin/env.sh: FixedENV_SCRIPT_DIRto useBASH_SOURCE[0]instead of$0for reliable script directory detection, changeduv syncto use absolute path/usr/local/bin/uv syncremediate internal2 files
env.shuv sync
pyvider-telemetry/pyproject.toml: Dependency version adjustments baseline behavioral1 file
pyproject.toml