Skip to content

🧪 [testing improvement] Add unit tests for resolve_url_template#45

Open
tahamukhtar20 wants to merge 1 commit into
mainfrom
testing-improvement-resolve-url-template-104259651370416581
Open

🧪 [testing improvement] Add unit tests for resolve_url_template#45
tahamukhtar20 wants to merge 1 commit into
mainfrom
testing-improvement-resolve-url-template-104259651370416581

Conversation

@tahamukhtar20

Copy link
Copy Markdown
Owner

🎯 What: The testing gap addressed

The resolve_url_template function in src/mapcv/downloader.py was previously untested. This function is responsible for determining the final tile URL template used for downloading satellite imagery, making it a critical component of the downloading pipeline.

📊 Coverage: What scenarios are now tested

  • Explicit Template: Verified that providing a custom url_template returns it as-is.
  • Built-in Sources: Verified that providing a known source (like "osm") correctly resolves to its predefined URL.
  • Precedence Logic: Confirmed that url_template takes priority if both it and a source are provided.
  • Validation: Added tests for ValueError when an unknown source is provided or when both arguments are None.

✨ Result: The improvement in test coverage

Unit test coverage for the downloader.py module has been increased, specifically securing the logic for tile source resolution against regressions.


PR created automatically by Jules for task 104259651370416581 started by @tahamukhtar20

This commit adds comprehensive unit tests for the `resolve_url_template`
function in `src/mapcv/downloader.py`. The tests cover the following scenarios:
- Explicit URL template usage.
- Built-in source resolution (e.g., "osm").
- Precedence of explicit templates over built-in sources.
- Error handling for unknown source names.
- Error handling for missing required arguments.

These tests ensure that tile URL resolution remains reliable as new
sources are added or the logic is refactored.

Co-authored-by: tahamukhtar20 <91777330+tahamukhtar20@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

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

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.

1 participant