Skip to content

Add round-trip regression tests for _parse_ccsds_head - #70

Merged
namurphy merged 5 commits into
PlasmaPy:mainfrom
namurphy:more-tests
Oct 7, 2026
Merged

namurphy merged 5 commits into
PlasmaPy:mainfrom
namurphy:more-tests

Conversation

@namurphy

@namurphy namurphy commented Oct 7, 2026

Copy link
Copy Markdown
Member

Adds tests/decommutator/test_ccsds_reader_pipeline.py with unit tests for _parse_ccsds_head. These are the first tests of an individual decommutator function; until now the decommutator was only tested end to end through the command line tool.

A test helper, _make_ccsds_head, packs header fields into 10 bytes with struct.pack, independently of the code under test. The tests check that:

  • Decoding an encoded header gives back the original fields. Cases cover a typical SPC header, a few APIDs including the largest (0x7FF), all fields zero, and all fields at their maximum.
  • Setting every bit of one field does not change any other field.
  • Bytes after the first 10 are ignored.
  • Headers shorter than 10 bytes raise ValueError.

🤖 Generated with Claude Code

namurphy and others added 2 commits October 7, 2026 15:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@namurphy namurphy changed the title Add round-trip tests for _parse_ccsds_head Add round-trip regression tests for _parse_ccsds_head Oct 7, 2026
Comment thread tests/decommutator/test_ccsds_reader_pipeline.py Outdated
Comment thread tests/decommutator/test_ccsds_reader_pipeline.py
Comment thread tests/decommutator/test_ccsds_reader_pipeline.py Outdated
@namurphy

namurphy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

I read through these and the tests seemed sensible, though admittedly I don't have a full understanding of the functionality.

Important

These tests should be thought of as regression tests to make sure that changes to the code preserve existing behavior.

@namurphy
namurphy merged commit 466fd90 into PlasmaPy:main Oct 7, 2026
15 checks passed
@namurphy
namurphy deleted the more-tests branch October 7, 2026 21:05
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.

1 participant