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 patterns
  • test_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 tests
  • test_client_integration.py `test_client_integration.py`: Minor adjustments to integration test setup
  • test_connection.py `test_connection.py`: Simplified by ~111 lines, removing redundant connection management tests
  • test_client_grpc.py: Fixed Unix socket channel test to use AsyncMock(spec=UnixSocketTransport) instead of bare MagicMock(), corrected the channel creation assertion to not expect extra ANY arguments, added proper import for UnixSocketTransport qualify internal
    1 file
    • test_client_grpc.py
  • test_client_handshake.py: Rewrote all handshake tests (~118 lines changed) to use patch('pyvider.rpcplugin.client.base.RPCPluginClient._relay_stderr_background', new_callable=AsyncMock) instead of patch.object(client_instance, ...), consolidated nested with blocks into single multi-context-manager with statements, added assertions verifying mock_relay.assert_called_once() and that client_instance._transport is mock_transport_instance, fixed the process exit test to set both mock_process.poll.return_value and mock_process.returncode qualify internal
    1 file
    • test_client_handshake.py
  • test_client_init.py: Updated ~80 lines, improving initialization test patterns qualify internal
    1 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 internal
    1 file
    • test_client_lifecycle.py
  • test_client_stubs.py: Expanded by ~106 lines, improving stub method test coverage and mock patterns qualify internal
    1 file
    • test_client_stubs.py
  • test_client_transport.py: Updated ~32 lines of transport-related tests qualify internal
    1 file
    • test_client_transport.py
  • test_client_integration.py: Minor adjustments to integration test setup qualify internal
    1 file
    • test_client_integration.py
  • test_connection.py: Simplified by ~111 lines, removing redundant connection management tests qualify internal
    1 file
    • test_connection.py

Crypto Certificate Test Fixes

4 files changed
  • test_certificate_chains.py `test_certificate_chains.py`: Minor chain validation test adjustments
  • test_certificate_create.py `test_certificate_create.py`: Updated ~29 lines of certificate creation tests
  • test_certificate_lifecycle.py `test_certificate_lifecycle.py`: Updated ~22 lines of certificate lifecycle tests
  • test_certificate_loading.py `test_certificate_loading.py`: Simplified certificate loading test assertions
  • test_certificate_chains.py: Minor chain validation test adjustments qualify internal
    1 file
    • test_certificate_chains.py
  • test_certificate_create.py: Updated ~29 lines of certificate creation tests qualify internal
    1 file
    • test_certificate_create.py
  • test_certificate_lifecycle.py: Updated ~22 lines of certificate lifecycle tests qualify internal
    1 file
    • test_certificate_lifecycle.py
  • test_certificate_loading.py: Simplified certificate loading test assertions qualify internal
    1 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 internal
    1 file
    • base.py
  • crypto/certificate.py: Updated ~68 lines in the certificate module, improving certificate handling to match corrected test expectations qualify internal
    1 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: Fixed ENV_SCRIPT_DIR to use BASH_SOURCE[0] instead of $0 for reliable script directory detection, changed uv sync to use absolute path /usr/local/bin/uv sync remediate internal
    2 files
    • env.sh
    • uv sync
  • pyvider-telemetry/pyproject.toml: Dependency version adjustments baseline behavioral
    1 file
    • pyproject.toml