Skip to content

Conversation

@robertjkeller
Copy link
Owner

Refactored some modules for easier testing.
Added tests for arinc and database modules.

@robertjkeller robertjkeller requested a review from Copilot April 29, 2025 02:36
@robertjkeller robertjkeller self-assigned this Apr 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive unit tests for the database and ARINC modules and refactors modules for improved testability. Key changes include new tests for PostgresDb, SqliteDb, and ARINC parsing; refactoring of main.py to remove redundancies; and the addition of pragma comments for test coverage.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_database.py New unit tests for validating database behavior and SQL execution.
tests/test_arinc.py New unit tests covering ARINC parsing and record processing.
src/record_maps.py Formatting updates and added pragma comments to exclude from coverage.
src/main.py Removed duplicate ARINC classes; streamlined parser initialization.
src/database.py Added pragma comments for coverage and minor comment updates.
src/config.py Removed redundant checks, relying on external config validation.
src/arinc.py Moved ARINC parsing logic from main to a dedicated module.
Comments suppressed due to low confidence (1)

src/arinc.py:37

  • Consider adding tests to handle cases where the input file content is shorter than expected, so that the get_cycle method does not raise an unexpected error.
return self.lines[0][35:39]

@robertjkeller robertjkeller merged commit 5609bc6 into main Apr 29, 2025
2 checks passed
@robertjkeller robertjkeller deleted the add-more-unit-tests branch April 29, 2025 02:37
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.

2 participants