Skip to content

Commit 9aba9f0

Browse files
authored
Merge pull request #102 from urschrei/shugel/push-oxsqwlokvytw
Add loop test
2 parents 0ec365d + 002f544 commit 9aba9f0

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
id: windows
5757

5858
steps:
59-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@v5
6060
with:
6161
fetch-depth: 0 # Optional, use if you use setuptools_scm
6262
submodules: true # Optional, use if you have submodules
@@ -133,7 +133,7 @@ jobs:
133133
name: Make SDist
134134
runs-on: ubuntu-latest
135135
steps:
136-
- uses: actions/checkout@v4
136+
- uses: actions/checkout@v5
137137
with:
138138
fetch-depth: 0 # Optional, use if you use setuptools_scm
139139
submodules: true # Optional, use if you have submodules
@@ -157,7 +157,7 @@ jobs:
157157
contents: write
158158

159159
steps:
160-
- uses: actions/checkout@v4
160+
- uses: actions/checkout@v5
161161
with:
162162
fetch-depth: 0 # Optional, use if you use setuptools_scm
163163
submodules: true # Optional, use if you have submodules

tests/test_convertbng.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import unittest
2-
import numpy as np
31
import array
42
import math
3+
import unittest
4+
from ctypes import ArgumentError
5+
from random import randint, randrange
6+
7+
import numpy as np
8+
from convertbng.cutil import convert_bng as cconvert_bng
9+
510
from convertbng.util import (
611
convert_bng,
12+
convert_epsg3857_to_wgs84,
13+
convert_etrs89_to_lonlat,
14+
convert_etrs89_to_osgb36,
715
convert_lonlat,
8-
convert_to_osgb36,
9-
convert_osgb36_to_lonlat,
1016
convert_osgb36_to_etrs89,
11-
convert_etrs89_to_osgb36,
12-
convert_etrs89_to_lonlat,
13-
convert_epsg3857_to_wgs84,
17+
convert_osgb36_to_lonlat,
1418
convert_to_etrs89,
19+
convert_to_osgb36,
1520
)
16-
from convertbng.cutil import convert_bng as cconvert_bng
17-
from ctypes import ArgumentError
18-
from random import randrange
1921

2022

2123
class ConvertbngTests(unittest.TestCase):
@@ -58,6 +60,16 @@ def testCythonConvertList(self):
5860
)
5961
self.assertEqual(expected[0][0], result[0][0])
6062

63+
def test_loop(self):
64+
"""See https://github.com/urschrei/convertbng/issues/101"""
65+
66+
def test_conversion(easting, northing):
67+
res = convert_lonlat(easting, northing)
68+
return [res[0][0], res[1][0]]
69+
70+
for i in range(500000):
71+
test_conversion([randint(10000, 50000)], [randint(10000, 50000)])
72+
6173
def testConvertBNG(self):
6274
"""Test multithreaded BNG --> lon, lat function"""
6375
expected = ([-0.32822654, -2.01831267], [51.44533145, 54.58910534])

0 commit comments

Comments
 (0)