Skip to content

Commit

Permalink
[LLM] Updated imports with 'noqa: F401' in stripe/_util.py, added ass…
Browse files Browse the repository at this point in the history
…ertion in tests/test_exports.py, swapped 'http_client' to '_http_client' in tests/test_http_client.py and replaced 'util' with '_util' in tests/test_util.py.
  • Loading branch information
pakrym-stripe committed Dec 7, 2023
1 parent 4818cc3 commit 12476d5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions stripe/_util.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import functools
import hmac
import io
import io # noqa: F401
import logging
import sys
import os
import re
import warnings

from urllib.parse import parse_qsl, quote_plus
from urllib.parse import parse_qsl, quote_plus # noqa: F401

from typing_extensions import Type, TYPE_CHECKING
from typing import (
Expand Down
1 change: 1 addition & 0 deletions tests/test_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def test_can_import_util() -> None:
convert_to_stripe_objectFromStripe
is convert_to_stripe_objectFromStripeUtil
)
assert stripe.util.io is not None # type: ignore


def test_can_import_errors() -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,8 @@ class FakeException(BaseException):
def args(self):
return ("foo", "bar")

stripe.http_client.pycurl.error = FakeException
mock.perform.side_effect = stripe.http_client.pycurl.error
stripe._http_client.pycurl.error = FakeException
mock.perform.side_effect = stripe._http_client.pycurl.error

return mock_error

Expand Down
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def log_test_loop(self, test_cases, logging_func, logger_name, mocker):
logger_mock = mocker.patch(logger_name)
print_mock = mocker.patch(PRINT_FUNC_STRING)
mocker.patch("stripe.log", case.flag)
mocker.patch("stripe.util.STRIPE_LOG", case.env)
mocker.patch("stripe._util.STRIPE_LOG", case.env)

logging_func("foo \nbar", y=3) # function under test

Expand Down

0 comments on commit 12476d5

Please sign in to comment.