From c8ae4ff3993092a0a01b89ce0542aacdbd4d958c Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 14 Jul 2023 18:29:47 +0200 Subject: [PATCH 1/3] fix tests --- staticmap/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/staticmap/tests.py b/staticmap/tests.py index 70904ee..c9771af 100644 --- a/staticmap/tests.py +++ b/staticmap/tests.py @@ -1,19 +1,19 @@ from unittest import TestCase -from staticmap import StaticMap +from staticmap.staticmap import _lat_to_y, _lon_to_x, _y_to_lat, _x_to_lon class LonLatConversionTest(TestCase): def testLon(self): for lon in range(-180, 180, 20): for zoom in range(0, 10): - x = _lon_to_x(zoom) - l = _x_to_lon(zoom) + x = _lon_to_x(lon, zoom) + l = _x_to_lon(x, zoom) self.assertAlmostEqual(lon, l, places=5) def testLat(self): for lat in range(-89, 89, 2): for zoom in range(0, 10): - y = _lat_to_y(zoom) - l = _y_to_lat(zoom) + y = _lat_to_y(lat, zoom) + l = _y_to_lat(y, zoom) self.assertAlmostEqual(lat, l, places=5) From eb339f83982ed2f148a55493904fc2a10ec8b491 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 26 Jul 2023 16:21:28 +0200 Subject: [PATCH 2/3] add github actions to run unit tests --- .github/workflows/.tests-python.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/.tests-python.yml diff --git a/.github/workflows/.tests-python.yml b/.github/workflows/.tests-python.yml new file mode 100644 index 0000000..4b58c3b --- /dev/null +++ b/.github/workflows/.tests-python.yml @@ -0,0 +1,26 @@ +name: Unit tests + +on: + push: + pull_request: + +jobs: + tests: + name: python ${{ matrix.python-version }} + runs-on: ubuntu-latest + container: python:${{ matrix.python-version }} + strategy: + matrix: + python-version: [ "3.8", "3.9", "3.10", "3.11" ] + steps: + - uses: actions/checkout@v3 + - name: Upgrade pip + run: python3 -m pip install --upgrade pip + - name: Create and source virtual environment + run: | + python3 -m venv .venv + . .venv/bin/activate + - name: Install requirements + run: python3 -m pip install -r requirements.txt + - name: Run unit tests + run: python -m unittest From 8df5e248096c8f87ef0b08a8cd5208da470daccd Mon Sep 17 00:00:00 2001 From: "sam@samr1.net" Date: Wed, 16 Apr 2025 11:48:47 +0200 Subject: [PATCH 3/3] update python versions used in tests --- .github/workflows/.tests-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/.tests-python.yml b/.github/workflows/.tests-python.yml index 4b58c3b..91f551a 100644 --- a/.github/workflows/.tests-python.yml +++ b/.github/workflows/.tests-python.yml @@ -11,7 +11,7 @@ jobs: container: python:${{ matrix.python-version }} strategy: matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] steps: - uses: actions/checkout@v3 - name: Upgrade pip