Draft
Conversation
Agent-Logs-Url: https://github.com/sigmf/sigmf-python/sessions/a19ae54f-6f9b-46e2-acd0-72987bf4d76c Co-authored-by: 777arc <5722532+777arc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests for SigMFCollection functionality
Add comprehensive tests for SigMFCollection
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SigMFCollectionhad 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 constructorTestCollectionRoundTrip— write/read round-trip verifying metadata fields,get_collection_info(), and raw JSON structure (streamname/hashentries)TestCollectionValidation— schema-valid cases (minimal, all optional fields, extensions array) and invalid cases (missingcore:version, missingcollectiontop-level key)TestCollectionCommonUseCases— covers:__len__,get_stream_namesget_SigMFFileby index, by name, and with an unknown name (returnsNone)set_collection_field/get_collection_fieldincluding default value fallbackset_collection_info/get_collection_infoset_streamshash recomputationskip_checksums=Trueon the constructorSigMFFileExistsError) andoverwrite=Trueverify_stream_hashes— passes on valid hashes, raisesSigMFFileErroron corrupted hashdumps()produces valid JSON with expected structure