8000 Merge pull request #165 from maxmind/greg/revert-mocket-hack · akx/GeoIP2-python@c2a7d74 · GitHub
[go: up one dir, main page]

Skip to content

Commit c2a7d74

Browse files
authored
Merge pull request maxmind#165 from maxmind/greg/revert-mocket-hack
Test with HTTPS again
2 parents ec0bada + 235d9cf commit c2a7d74

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

geoip2/webservice.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
f"GeoIP2-Python-Client/{geoip2.__version__} {requests.utils.default_user_agent()}"
5757
)
5858

59-
# We have this so that we can avoid a mocket issue:
60-
# https://github.com/mindflayer/python-mocket/issues/209
61-
_SCHEME = "https"
62-
6359

6460
class BaseClient: # pylint: disable=missing-class-docstring, too-few-public-methods
6561
_account_id: str
@@ -88,7 +84,7 @@ def __init__(
8884
account_id if isinstance(account_id, bytes) else str(account_id)
8985
)
9086
self._license_key = license_key
91-
self._base_uri = f"{_SCHEME}://{host}/geoip/v2.1"
87+
self._base_uri = f"https://{host}/geoip/v2.1"
9288
self._timeout = timeout
9389

9490
def _uri(self, path: str, ip_address: IPAddress) -> str:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ classifiers = [
3737

3838
[project.optional-dependencies]
3939
test = [
40-
"mocket>=3.11.1",
40+
"mocket>=3.12.3",
4141
]
4242

4343
[tool.setuptools.package-data]

tests/webservice_test.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,11 @@
2525
OutOfQueriesError,
2626
PermissionRequiredError,
2727
)
28-
import geoip2.webservice
2928
from geoip2.webservice import AsyncClient, Client
3029

31-
# We have this so that we can avoid a mocket issue:
32-
# https://github.com/mindflayer/python-mocket/issues/209
33-
geoip2.webservice._SCHEME = "http"
34-
3530

3631
class TestBaseClient(unittest.TestCase):
37-
base_uri = "http://geoip.maxmind.com/geoip/v2.1/"
32+
base_uri = "https://geoip.maxmind.com/geoip/v2.1/"
3833
country = {
3934
"continent": {"code": "NA", "geoname_id": 42, "names": {"en": "North America"}},
4035
"country": {

0 commit comments

Comments
 (0)
0