chore: update docs for system-wide installation and expand test coverage
Summary
This MR updates project documentation to reflect modern installation workflows (global uv tool install) and significantly expands test coverage across the CLI codebase.
Changes
Documentation
-
README.md & docs/user-manual.md
- Added system-wide installation instructions via
uv tool installandpipx - Added development installation section with
uv sync - Updated all command examples from
uv run corpus-client …tocorpus-client … - Added new
corpus-client statuscommand to the reference list - Added step-by-step record upload guide
- Expanded FAQ with common questions (multiple directories, file size limits, non-interactive credentials)
- Added system-wide installation instructions via
Bug Fix
-
src/corpus_client_cli/job.py
- Fixed Python 2-style exception tuple syntax (
except A, B:→except (A, B):)
- Fixed Python 2-style exception tuple syntax (
Code Quality
-
src/corpus_client_cli/upload.py
- Minor line-length formatting fix
Test Coverage
-
tests/test_extracted_text_upload.py
-
ExtractedTextStateedge cases (load errors, legacy log, save failures) -
parse_dots_ocredge cases (footer, image caption/footnote strings, empty text, reading order) -
GeneralizedExtractedTextUploadertests (409 response, non-200 errors, generic exceptions)
-
-
tests/test_output.py (new file)
- Tests for
output()JSON and non-JSON modes - Tests for
log()stderr output
- Tests for
-
tests/test_retry_logic.py
-
with_retryedge cases (non-tuple results, exhausted retries, zero max retries) -
format_error_payloadcomprehensive tests (strings, lists, dicts, validation errors) -
_format_validation_itemtests -
read_response_payloadandread_error_messageasync tests
-
-
tests/test_s3_upload.py
-
upload_single_shottests (non-list category IDs, error responses, exceptions) -
process_filetests (chunk failure, finalize failure, exception with cleanup) -
UploadStatetests (job path restore, progress log exception handling) -
finalize_uploadresponse payload error handling
-
-
tests/test_upload.py
-
resolve_file_patterntests (no pattern, extensions, recursive glob) -
ProgressTrackertests -
process_filetests (not found, validation fails, finalize fails, success path)
-
-
tests/test_upload_state.py
- Load with progress log, save throttling, force save, corrupted log handling, append log errors
-
tests/test_validation_fail_fast.py
- Extensive validation helper tests (
_normalize_mime_type,_words,_looks_like_repeated_characters,_size_limits_for_media_type,_guess_mime_type) -
validate_title,validate_description,validate_source_fields,validate_release_rights,validate_coordinates,validate_inline_text_contenttests -
validate_file_before_uploadedge cases (OSError, size limits, MIME detection, duration checks)
- Extensive validation helper tests (
Edited by Ahlad Pataparla