Skip to content

🧪 Add unit tests for bbmDecode in nmea module - #14

Open
google-labs-jules[bot] wants to merge 4 commits into
mainfrom
add-bbm-decode-tests-14797675939760096973
Open

🧪 Add unit tests for bbmDecode in nmea module#14
google-labs-jules[bot] wants to merge 4 commits into
mainfrom
add-bbm-decode-tests-14797675939760096973

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🎯 What: The testing gap in src/aisutils/nmea.py for the bbmDecode function was addressed.

📊 Coverage: The new tests cover:

  • Decoding of a valid BBM message
  • Checksum validation handling (with validate=True and validate=False)
  • Incorrect field count error handling

Result: Test coverage for src/aisutils/nmea.py is 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

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.
@google-labs-jules
google-labs-jules Bot requested a review from schwehr as a code owner August 5, 2026 05:44
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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.
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.

0 participants