Skip to content

Add integration tests for server block ops and USERDATA handlers#644

Merged
gijzelaerr merged 1 commit intomasterfrom
test/server-coverage
Mar 20, 2026
Merged

Add integration tests for server block ops and USERDATA handlers#644
gijzelaerr merged 1 commit intomasterfrom
test/server-coverage

Conversation

@gijzelaerr
Copy link
Copy Markdown
Owner

Summary

  • Adds 32 new integration tests in tests/test_server_coverage.py exercising server-side protocol handlers through real client-server communication
  • Tests cover block operations (list_blocks, list_blocks_of_type, get_block_info, upload, download), USERDATA handlers (SZL reads for all 5 supported IDs, clock get/set, CPU info/state), PLC control (stop/hot_start/cold_start/compress/copy_ram_to_rom), and error scenarios (unregistered areas, bounds violations, nonexistent blocks)
  • Improves snap7/server/__init__.py statement coverage from 74% to 75% (9 additional lines covered; remaining gaps are mainloop, ServerISOConnection thread internals, and network error branches)

Test plan

  • All 32 new tests pass: uv run pytest tests/test_server_coverage.py -v
  • Full test suite passes (479 passed, 48 skipped): uv run pytest tests/ --ignore=tests/test_s7commplus_e2e.py -q
  • Ruff check and format pass: uv run ruff check tests/test_server_coverage.py && uv run ruff format --check tests/test_server_coverage.py

🤖 Generated with Claude Code

Adds 32 new tests exercising server-side protocol handlers through
real client-server communication: block list/info/upload/download,
SZL reads, clock get/set, PLC control (stop/start/compress), and
error scenarios for unregistered areas and nonexistent blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gijzelaerr gijzelaerr merged commit 6ccacf5 into master Mar 20, 2026
37 checks passed
@gijzelaerr gijzelaerr added this to the 3.1 milestone Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant