tools: implement dynamic jupyter utils tests using session_with_data#7209
tools: implement dynamic jupyter utils tests using session_with_data#7209AkshadSonawane wants to merge 2 commits intoOSGeo:mainfrom
Conversation
|
This is an overkill for one simple function. The test file could cover all the functions in utils. You can use session_with_data and test the actual values. What is the integration mark for? |
7308409 to
686ee28
Compare
@petrasovaa The logic is now centralized in I've also updated the PR description and included a clean test run. Looking forward to your feedback! |
db0850e to
5b8c2df
Compare
5b8c2df to
797583f
Compare
|
Hi @petrasovaa, Working on this PR along with #7207 gave me a good understanding of both the As a next step, I’m interested in applying this testing strategy to the higher-level rendering classes in I’m planning to prototype this for Thanks! |
There was a problem hiding this comment.
should be probably grass_jupyter_utils_test.py.
| assert result["west"] == pytest.approx(expected["w"]) | ||
|
|
||
|
|
||
| def test_get_rendering_size(): |
There was a problem hiding this comment.
what about if neither width or height are provided?
There was a problem hiding this comment.
Thanks, good point. When neither width nor height is given, the function falls back to the default bounding box limits and computes the final size from the region aspect ratio.
I updated the test to cover that case and added checks for both a wide region and a tall region, since the function handles those two sizing paths separately. I also renamed the file to grass_jupyter_utils_test.py. I ran the updated tests locally and they pass.
6b0a28f to
f8f9a49
Compare
Reopening and updating after feedback on #7198.
Updates in this iteration
utils.py.session_with_datafixture instead of mocks or hardcoded values.test_get_regionnow dynamically validates output against the native backend (gs.region()), so it works consistently both locally and with the CI North Carolina dataset.@pytest.mark.parametrize.Local test run