Skip to content

Commit

Permalink
Merge pull request #134 from maxmind/greg/revert-mocket-hack
Browse files Browse the repository at this point in the history
Use HTTPS in tests again
  • Loading branch information
faktas2 authored Jan 21, 2024
2 parents dfea891 + 7ee9737 commit 687a929
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions minfraud/webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

_REQUEST_UA = f"minFraud-API/{__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"


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

base_uri = f"{_SCHEME}://{host}/minfraud/v2.0"
base_uri = f"https://{host}/minfraud/v2.0"
self._score_uri = "/".join([base_uri, "score"])
self._insights_uri = "/".join([base_uri, "insights"])
self._factors_uri = "/".join([base_uri, "factors"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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/test_webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@
from minfraud.models import Factors, Insights, Score
from minfraud.webservice import AsyncClient, Client

import minfraud.webservice
import unittest

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


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

base_uri = "http://minfraud.maxmind.com/minfraud/v2.0"
base_uri = "https://minfraud.maxmind.com/minfraud/v2.0"

@httprettified
def test_invalid_auth(self):
Expand Down

0 comments on commit 687a929

Please sign in to comment.