Skip to content

Commit

Permalink
Merge pull request #165 from maxmind/greg/revert-mocket-hack
Browse files Browse the repository at this point in the history
Test with HTTPS again
  • Loading branch information
faktas2 authored Jan 21, 2024
2 parents ec0bada + 235d9cf commit c2a7d74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions geoip2/webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
f"GeoIP2-Python-Client/{geoip2.__version__} {requests.utils.default_user_agent()}"
)

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


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

def _uri(self, path: str, ip_address: IPAddress) -> str:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [

[project.optional-dependencies]
test = [
"mocket>=3.11.1",
"mocket>=3.12.3",
]

[tool.setuptools.package-data]
Expand Down
7 changes: 1 addition & 6 deletions tests/webservice_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,11 @@
OutOfQueriesError,
PermissionRequiredError,
)
import geoip2.webservice
from geoip2.webservice import AsyncClient, Client

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


class TestBaseClient(unittest.TestCase):
base_uri = "http://geoip.maxmind.com/geoip/v2.1/"
base_uri = "https://geoip.maxmind.com/geoip/v2.1/"
country = {
"continent": {"code": "NA", "geoname_id": 42, "names": {"en": "North America"}},
"country": {
Expand Down

0 comments on commit c2a7d74

Please sign in to comment.