Skip to content

Commit 7ee9737

Browse files
committed
Use HTTPS in tests again
mocket 3.12.3 fixes an interaction with aiohttp that prevented HTTPS from working with it.
1 parent dfea891 commit 7ee9737

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

minfraud/webservice.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232

3333
_REQUEST_UA = f"minFraud-API/{__version__} {requests.utils.default_user_agent()}"
3434

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

4036
# pylint: disable=too-many-instance-attributes, missing-class-docstring
4137
class BaseClient:
@@ -62,7 +58,7 @@ def __init__(
6258
self._license_key = license_key
6359
self._timeout = timeout
6460

65-
base_uri = f"{_SCHEME}://{host}/minfraud/v2.0"
61+
base_uri = f"https://{host}/minfraud/v2.0"
6662
self._score_uri = "/".join([base_uri, "score"])
6763
self._insights_uri = "/".join([base_uri, "insights"])
6864
self._factors_uri = "/".join([base_uri, "factors"])

pyproject.toml

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

3636
[project.optional-dependencies]
3737
test = [
38-
"mocket>=3.11.1",
38+
"mocket>=3.12.3",
3939
]
4040

4141
[tool.setuptools.package-data]

tests/test_webservice.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
from minfraud.models import Factors, Insights, Score
2020
from minfraud.webservice import AsyncClient, Client
2121

22-
import minfraud.webservice
2322
import unittest
2423

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

3025
class BaseTest(unittest.TestCase):
3126
client_class: Union[Type[AsyncClient], Type[Client]] = Client
@@ -41,7 +36,7 @@ def setUp(self):
4136
with open(os.path.join(test_dir, self.response_file), encoding="utf-8") as file:
4237
self.response = file.read()
4338

44-
base_uri = "http://minfraud.maxmind.com/minfraud/v2.0"
39+
base_uri = "https://minfraud.maxmind.com/minfraud/v2.0"
4540

4641
@httprettified
4742
def test_invalid_auth(self):

0 commit comments

Comments
 (0)