Skip to content

grass.jupyter: Add comprehensive tests for utils.py#7205

Open
saurabh12nxf wants to merge 2 commits intoOSGeo:mainfrom
saurabh12nxf:add-utils-tests
Open

grass.jupyter: Add comprehensive tests for utils.py#7205
saurabh12nxf wants to merge 2 commits intoOSGeo:mainfrom
saurabh12nxf:add-utils-tests

Conversation

@saurabh12nxf
Copy link
Contributor

Description

This PR adds comprehensive pytest tests for the grass.jupyter.utils module, which previously had minimal test coverage.

Changes

Added 21 new tests covering 5 critical utility functions:
get_region() - 6 tests validating region dictionary structure
get_location_proj_string() - 3 tests for projection string handling
get_rendering_size() - 8 tests for aspect ratio calculations
get_number_of_cores() - 4 tests for CPU allocation logic
reproject_region() - 4 tests for coordinate transformation (skipped for XY locations)

Testing
All tests pass both in isolation and when run with the full test suite:
pytest python/grass/jupyter/tests/test_utils.py -v ✅ 21 passed, 4 skipped
pytest python/grass/jupyter/tests/ -v ✅ 73 passed, 4 skipped

@github-actions github-actions bot added Python Related code is in Python libraries tests Related to Test Suite notebook labels Mar 21, 2026
@saurabh12nxf saurabh12nxf changed the title Add comprehensive tests for grass.jupyter.utils grass.jupyter : Add comprehensive tests for utils.py Mar 21, 2026
@saurabh12nxf saurabh12nxf changed the title grass.jupyter : Add comprehensive tests for utils.py grass.jupyter: Add comprehensive tests for utils.py Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries notebook Python Related code is in Python tests Related to Test Suite

1 participant