f62e1a7881
The SftpClient wrapper previously exposed write_file, list_inbound, list_inbound_names, download_inbound, and read_file — but NO stat(). The canonical cyclone.submission.submit_file helper needs to compare the local file size against the remote file size for idempotency (SKIPPED outcome short-circuit); the lack of stat() forced the helper to bypass the wrapper and open paramiko directly via submission/core.py:_default_sftp_factory. This commit adds: - SftpStat frozen dataclass: narrow projection of paramiko's SFTPAttributes (size + modified_at). Callers don't need paramiko. - SftpClient.stat(remote_path) -> SftpStat public method - _stat_stub + _stat_paramiko backends (mirrors the existing _read_file_stub / _read_file_paramiko pattern) - 8 new tests covering dataclass shape, frozen invariant, stub size, stub mtime, missing-file FileNotFoundError, large-file size, and the actual SKIPPED-outcome idempotency check from submit_file Also adds backend/var/ to .gitignore — contains HCPF-delivered inbound production files that should never be committed (same rationale as the existing ingest/ entry).
11 lines
94 B
Plaintext
11 lines
94 B
Plaintext
__pycache__/
|
|
*.py[cod]
|
|
*.egg-info/
|
|
.pytest_cache/
|
|
.ruff_cache/
|
|
.venv/
|
|
venv/
|
|
build/
|
|
dist/
|
|
var/
|