Skip to content

## Test coverage: site

Test coverage: site.py build/publish

Add tests for untested site.py functions: build, publish, _serve_cmd, _build_cmd, _prepare_site_chatbot.

What to test

  • _build_cmd() / _serve_cmd(): verify correct command construction for mkdocs/sphinx/vite frameworks.
  • build(): verify it calls the right subprocess with correct args. Mock subprocess.
  • _prepare_site_chatbot(): verify chatbot asset injection when enabled in config.
  • Error paths: missing framework, missing config file.

Where

  • Source: src/projio/site.py
  • Tests: add to tests/test_site.py

Approach

Mock subprocess.run to avoid actually building sites. Use tmp_path with site config. Existing test_site.py covers detection and port management — add build/publish tests alongside.

Batch Result

  • status: done
  • batch queue_id: fa9ae36ce1aa
  • session: bf8a344f-5f23-4791-ab7b-17a624a7fc7f
  • batch duration: 441.8s