Skip to content
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
mainfrom
feat/unit-tests
Closed

Add unit tests and CI workflow#10
cmehat wants to merge 2 commits into
mainfrom
feat/unit-tests

Conversation

@cmehat

@cmehat cmehat commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add pytest test suite covering pure functions in update_gpx.py and generate_map.py (30 tests)
  • Add GitHub Actions CI workflow that runs tests on push/PR
  • Add pytest>=7,<9 to requirements.txt
  • Add test fixtures (minimal naming page HTML, sample GPX)
  • Remove Copolycube attribution from GPX creator string

Test plan

  • pip install -r requirements.txt && pytest tests/ -v — all 30 tests pass
  • CI workflow runs on PR push

cmehat added 2 commits June 9, 2026 13:50
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.
Copilot AI review requested due to automatic review settings June 9, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py and scripts/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,<9 to requirements.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 thread tests/conftest.py
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()
@cmehat

cmehat commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

This project has moved to oyatrino/tezosprotocolmap, where this work has already been merged. Closing as part of deprecating this repository.

@cmehat cmehat closed this Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants