This repository was archived by the owner on Jun 16, 2026. It is now read-only.
Add unit tests and CI workflow - #10
Closed
cmehat wants to merge 2 commits into
Closed
Conversation
Cover pure functions in update_gpx.py (format_coord, desc_for, build_wpt, parse_wpts, sort_key, gpx_coords_for_protocols, build_protocols_json, scrape_protocols) and generate_map.py (short_label, match_protocols) with 30 unit tests.
There was a problem hiding this comment.
Pull request overview
Adds a pytest-based unit test suite and a GitHub Actions workflow to run tests on push/PR, while updating the GPX creator string to remove the prior attribution.
Changes:
- Added 30 pytest unit tests for pure/helper functions in
scripts/update_gpx.pyandscripts/generate_map.py, plus fixtures and shared pytest fixtures. - Added a GitHub Actions workflow to run the test suite in CI.
- Updated GPX creator string and added
pytest>=7,<9torequirements.txt.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tezos.gpx | Updates the <gpx> creator attribute string. |
| scripts/update_gpx.py | Keeps the GPX header creator string consistent with the updated GPX file. |
| requirements.txt | Adds pytest to Python dependencies. |
| .github/workflows/test.yml | Introduces CI workflow to run pytest on push/PR. |
| tests/test_update_gpx.py | Adds unit tests for scripts/update_gpx.py helper/pure functions. |
| tests/test_generate_map.py | Adds unit tests for scripts/generate_map.py helper/pure functions. |
| tests/conftest.py | Adds shared pytest fixtures for reading fixture files. |
| tests/fixtures/tezos_sample.gpx | Adds a small GPX fixture used by tests. |
| tests/fixtures/naming_page.html | Adds a minimal naming-page HTML fixture used by tests. |
| tests/init.py | Adds test package marker file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+18
to
+22
| - name: Install dependencies | ||
| run: pip install requests beautifulsoup4 pytest | ||
|
|
||
| - name: Run tests | ||
| run: pytest tests/ -v |
Comment on lines
+11
to
+19
| def naming_html(): | ||
| """Minimal HTML with protocol list items.""" | ||
| return (FIXTURES / "naming_page.html").read_text() | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def sample_gpx_text(): | ||
| """GPX text with 4 sample waypoints.""" | ||
| return (FIXTURES / "tezos_sample.gpx").read_text() |
Contributor
Author
|
This project has moved to oyatrino/tezosprotocolmap, where this work has already been merged. Closing as part of deprecating this repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update_gpx.pyandgenerate_map.py(30 tests)pytest>=7,<9to requirements.txtTest plan
pip install -r requirements.txt && pytest tests/ -v— all 30 tests pass