CSV structure and column mapping — test record
Date: 2026-10-22
Scope: local file parsing and transformation; no new Excel application test.
Environment: Python 3.9.6 on macOS (Darwin).
Command: python3 test_csv_practice.py
Result: 37 assertions passed.

- Quoted file: three records, five physical lines
- Quoted file: exact comma, quote and embedded CRLF values
- Mapping: all three source counts retained
- Mapping: complete output matches independent expected file byte for byte
- Mapping: identifiers and reordered region preserved
- Mapping: amount total reconciles to 60.00
- Existing output is protected
- Protected output unchanged
- Repeated source path rejected
- unclosed_quote rejected before output
- unclosed_quote creates no partial output
- extra_field rejected before output
- extra_field creates no partial output
- duplicate_header rejected before output
- duplicate_header creates no partial output
- spaced_header rejected before output
- spaced_header creates no partial output
- blank_header rejected before output
- blank_header creates no partial output
- empty_file rejected before output
- empty_file creates no partial output
- blank_record rejected before output
- blank_record creates no partial output
- invalid_utf8 rejected before output
- invalid_utf8 creates no partial output
- missing_required rejected before output
- missing_required creates no partial output
- unexpected_header rejected before output
- unexpected_header creates no partial output
- case_changed_header rejected before output
- case_changed_header creates no partial output
- Present but empty region differs from absent column
- Zero amount remains literal zero
- CSV writer/reader round trip preserves field values
- Inspection CLI succeeds with escaped CRLF in JSON
- Mapping CLI produces expected bytes
- All practice source bytes unchanged

Source file SHA-256 hashes:
quotes-input.csv  4be72ee95fa47008630e3072315f9f8bcac42252b13d4b1ba0770936bcfc69b8
schema-a.csv  72d4d6527a4d4ce7ea5a4be76098a203b7b046d0989543ad46bdd0349c59a0c5
schema-b.csv  e276337d1ca23cec45ca069e789c955583eae0a2e9da1855e92259247c7590bb
schema-c.csv  cfd0c9a1068b2a82a44e4705a621bfba8f58f4241cf4e08bc9607d648967f655
schema-expected.csv  e1cf665871d9d7743f4cd6e423bffbf6a05c85688ef0fa8dac688253350ef86e

The runner creates malformed fixtures in a temporary directory and removes that directory when finished. Inputs remain unchanged. CLI tests exercise both scripts. Passing this suite does not prove compatibility with every CSV dialect, Python release, Excel version or business dataset.
