Skip to content

Add comprehensive tests for SigMFCollection#151

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-tests-for-sigmfcollection
Draft

Add comprehensive tests for SigMFCollection#151
Copilot wants to merge 2 commits intomainfrom
copilot/add-tests-for-sigmfcollection

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 29, 2026

SigMFCollection had almost no test coverage despite being a core part of the API. This PR adds 28 new tests across four classes covering round-trip serialization, schema validation, and common use cases.

New test classes

  • TestCollectionConstructor — empty constructor and metadata-initialized constructor
  • TestCollectionRoundTrip — write/read round-trip verifying metadata fields, get_collection_info(), and raw JSON structure (stream name/hash entries)
  • TestCollectionValidation — schema-valid cases (minimal, all optional fields, extensions array) and invalid cases (missing core:version, missing collection top-level key)
  • TestCollectionCommonUseCases — covers:
    • __len__, get_stream_names
    • get_SigMFFile by index, by name, and with an unknown name (returns None)
    • set_collection_field / get_collection_field including default value fallback
    • set_collection_info / get_collection_info
    • set_streams hash recomputation
    • skip_checksums=True on the constructor
    • Overwrite protection (SigMFFileExistsError) and overwrite=True
    • verify_stream_hashes — passes on valid hashes, raises SigMFFileError on corrupted hash
    • Error cases: non-existent metafile, wrong file extension
    • dumps() produces valid JSON with expected structure

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add tests for SigMFCollection functionality Add comprehensive tests for SigMFCollection Apr 29, 2026
Copilot AI requested a review from 777arc April 29, 2026 22:23
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.

add tests for SigMFCollection

2 participants