🧪 Add unit tests for bbmDecode in nmea module - #14
🧪 Add unit tests for bbmDecode in nmea module#14google-labs-jules[bot] wants to merge 4 commits into
Conversation
This commit introduces a new test file `tests/test_aisutils/test_nmea.py` to add coverage for the `bbmDecode` function in `src/aisutils/nmea.py`. The tests cover the following scenarios: 1. Happy path testing based on existing doctest example. 2. Error handling when an invalid checksum is provided but `validate` is False. 3. Error handling when an invalid checksum is provided and `validate` is True. 4. Error handling when a message contains an insufficient number of fields.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This commit replaces a direct call to `os.getlogin()` which can throw an `OSError: [Errno -25]` in headless CI environments (like GitHub actions). It falls back to `os.environ.get('USER', 'root')` if the `os.getlogin()` raises an exception.
This commit runs `uv run ruff check --fix` and `uv run ruff format` to resolve the sorting issues reported by the Ruff linter in `src/noaadata/cli/ais_receive_bbox.py` and `src/noaadata/dumpallwl.py`, as well as a small formatting issue in `tests/test_aisutils/test_nmea.py`.
This commit addresses some formatting, unresolved references, and typing errors reported by Ruff and Mypy. This ensures the linting and type checking steps pass on CI.
🎯 What: The testing gap in
src/aisutils/nmea.pyfor thebbmDecodefunction was addressed.📊 Coverage: The new tests cover:
validate=Trueandvalidate=False)✨ Result: Test coverage for
src/aisutils/nmea.pyis increased, ensuring future refactoring won't silently introduce regressions. Error messages from edge cases are explicitly tested.PR created automatically by Jules for task 14797675939760096973 started by @schwehr