trivial: apply isort (#58937)

This commit is contained in:
Serghei Mihai 2021-11-24 13:26:14 +01:00
parent 766991930a
commit 8bf4ab81c5
25 changed files with 124 additions and 143 deletions

View File

@ -17,24 +17,25 @@
import datetime
import importlib
import logging
import pytz
from .common import ( # noqa: F401
URL,
HTML,
FORM,
RECEIVED,
ACCEPTED,
PAID,
DENIED,
CANCELED,
CANCELLED,
DENIED,
ERROR,
WAITING,
EXPIRED,
force_text,
ResponseError,
FORM,
HTML,
PAID,
RECEIVED,
URL,
WAITING,
PaymentException,
ResponseError,
force_text,
)
__all__ = [

View File

@ -25,7 +25,7 @@ import tempfile
import click
from . import Payment, FORM, URL
from . import FORM, URL, Payment
def option(value):

View File

@ -16,8 +16,7 @@
'''Responses codes emitted by EMV Card or 'Carte Bleu' in France'''
from . import PAID, CANCELLED, ERROR, DENIED
from . import CANCELLED, DENIED, ERROR, PAID
CB_RESPONSE_CODES = {
'00': {'message': 'Transaction approuvée ou traitée avec succès', 'result': PAID},

View File

@ -14,21 +14,18 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path
import html
import logging
import os
import os.path
import random
import sys
import logging
from datetime import date
from decimal import ROUND_DOWN, Decimal
from gettext import gettext as _
import six
import html
from gettext import gettext as _
try:
if 'django' in sys.modules:
from django.utils.translation import ugettext_lazy as _

View File

@ -20,7 +20,7 @@ import warnings
from six.moves.urllib.parse import parse_qs, urlencode
from .common import PaymentCommon, PaymentResponse, ResponseError, URL, PAID, ERROR, WAITING, force_text, _
from .common import ERROR, PAID, URL, WAITING, PaymentCommon, PaymentResponse, ResponseError, _, force_text
__all__ = ['Payment']

View File

@ -14,22 +14,21 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .common import _
import requests
from six.moves.urllib.parse import parse_qs, urljoin
from .common import (
ACCEPTED,
CANCELLED,
ERROR,
PAID,
URL,
WAITING,
PaymentCommon,
PaymentException,
PaymentResponse,
ResponseError,
WAITING,
ACCEPTED,
_,
)
__all__ = ['Payment']

View File

@ -14,30 +14,30 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from decimal import Decimal, ROUND_HALF_UP
from six.moves.urllib import parse as urlparse
import hashlib
import uuid
from decimal import ROUND_HALF_UP, Decimal
from six.moves.urllib import parse as urlparse
from .common import (
ACCEPTED,
CANCELLED,
DENIED,
ERROR,
FORM,
ORDERID_TRANSACTION_SEPARATOR,
PAID,
WAITING,
Form,
PaymentCommon,
PaymentResponse,
FORM,
CANCELLED,
PAID,
ERROR,
Form,
DENIED,
ACCEPTED,
ORDERID_TRANSACTION_SEPARATOR,
WAITING,
ResponseError,
_,
force_byte,
force_text,
_,
)
ENVIRONMENT_TEST = 'TEST'
ENVIRONMENT_TEST_URL = 'https://secure.ogone.com/ncol/test/orderstandard.asp'
ENVIRONMENT_PROD = 'PROD'

View File

@ -14,43 +14,40 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import base64
import codecs
from collections import OrderedDict
import datetime
import logging
import hashlib
import hmac
import logging
import re
import requests
import uuid
import warnings
from collections import OrderedDict
import pytz
from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA
import requests
from Crypto.Hash import SHA
from six.moves.urllib import parse as urlparse
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from six.moves.urllib import parse as urllib
from six.moves.urllib import parse as urlparse
import base64
import warnings
from . import cb
from .common import (
PaymentCommon,
PaymentResponse,
FORM,
PAID,
CANCELLED,
DENIED,
ERROR,
FORM,
PAID,
Form,
PaymentCommon,
PaymentResponse,
ResponseError,
force_text,
force_byte,
_,
force_byte,
force_text,
)
from . import cb
__all__ = ['sign', 'Payment']

View File

@ -16,40 +16,38 @@
import copy
import decimal
import datetime
import decimal
import functools
import os
import random
import re
import requests
import unicodedata
import xml.etree.ElementTree as ET
import pytz
import requests
import six
from six.moves.urllib.parse import parse_qs
import zeep
import zeep.exceptions
from six.moves.urllib.parse import parse_qs
from .systempayv2 import isonow
from .common import (
PaymentCommon,
PaymentResponse,
URL,
PAID,
DENIED,
CANCELLED,
DENIED,
ERROR,
ResponseError,
PaymentException,
WAITING,
EXPIRED,
force_text,
PAID,
URL,
WAITING,
PaymentCommon,
PaymentException,
PaymentResponse,
ResponseError,
_,
force_text,
)
from .systempayv2 import isonow
# The URL of the WSDL published in the documentation is still wrong, it
# references XSD files which are not resolvable :/ we must use this other URL

View File

@ -17,22 +17,21 @@
import functools
from six.moves.urllib.parse import urljoin, parse_qs
import lxml.etree as ET
import zeep
import zeep.exceptions
from six.moves.urllib.parse import parse_qs, urljoin
from .common import (
PaymentException,
PaymentCommon,
ResponseError,
URL,
PAID,
DENIED,
CANCELLED,
DENIED,
ERROR,
PAID,
URL,
PaymentCommon,
PaymentException,
PaymentResponse,
ResponseError,
)
_zeep_transport = None

View File

@ -14,31 +14,29 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
import collections
import datetime
import hashlib
import hmac
import json
import uuid
import warnings
import pytz
import requests
from six.moves.urllib import parse as urlparse
import requests
import pytz
from .common import (
PaymentCommon,
FORM,
Form,
PaymentResponse,
PAID,
ERROR,
CANCELED,
ERROR,
FORM,
PAID,
Form,
PaymentCommon,
PaymentResponse,
ResponseError,
force_text,
_,
force_text,
)
__all__ = ['Payment']

View File

@ -15,31 +15,32 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import base64
import pytz
import datetime as dt
import hashlib
import hmac
import random
import re
import string
from six.moves.urllib import parse as urlparse
import warnings
import pytz
from six.moves.urllib import parse as urlparse
from .cb import translate_cb_error_code
from .common import (
PaymentCommon,
PaymentResponse,
PAID,
DENIED,
CANCELLED,
DENIED,
ERROR,
FORM,
PAID,
Form,
PaymentCommon,
PaymentResponse,
ResponseError,
force_text,
force_byte,
_,
force_byte,
force_text,
)
from .cb import translate_cb_error_code
__all__ = ['Payment']

View File

@ -16,16 +16,15 @@
import datetime
import decimal
import re
import logging
import random
import re
import warnings
import pytz
from six.moves.urllib.parse import parse_qs, urlencode
from .common import PaymentCommon, PaymentResponse, URL, PAID, DENIED, CANCELLED, ERROR, ResponseError, _
from six.moves.urllib.parse import urlencode, parse_qs
import logging
import warnings
from .common import CANCELLED, DENIED, ERROR, PAID, URL, PaymentCommon, PaymentResponse, ResponseError, _
__all__ = ['Payment']

View File

@ -4,25 +4,24 @@
Setup script for eopayment
'''
import distutils
import distutils.core
import doctest
import io
import os
import subprocess
import distutils
import distutils.core
from distutils.command.build import build as _build
from distutils.cmd import Command
from distutils.command.build import build as _build
from distutils.spawn import find_executable
from glob import glob
from os.path import basename
from os.path import join as pjoin
from os.path import splitext
from unittest import TestLoader, TextTestRunner
import setuptools
from setuptools.command.sdist import sdist
from setuptools.command.install_lib import install_lib as _install_lib
from glob import glob
from os.path import splitext, basename, join as pjoin
import os
from unittest import TextTestRunner, TestLoader
import doctest
from setuptools.command.sdist import sdist
class TestCommand(distutils.core.Command):

View File

@ -16,13 +16,11 @@
import json
import pytest
import httmock
import lxml.etree as ET
from requests.adapters import HTTPAdapter
import pytest
from requests import Session
from requests.adapters import HTTPAdapter
def pytest_addoption(parser):

View File

@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from datetime import date, datetime, timedelta
from unittest import mock
import pytest
import eopayment

View File

@ -14,11 +14,12 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from six.moves.urllib.parse import urlparse, parse_qs
import datetime
import eopayment
import pytest
from six.moves.urllib.parse import parse_qs, urlparse
import eopayment
@pytest.fixture

View File

@ -18,7 +18,7 @@ import json
import pytest
import requests
from httmock import response, urlmatch, HTTMock, with_httmock, all_requests, remember_called
from httmock import HTTMock, all_requests, remember_called, response, urlmatch, with_httmock
import eopayment
from eopayment.keyware import Payment

View File

@ -16,12 +16,12 @@
import json
import pytest
import requests
from httmock import remember_called, response, urlmatch, with_httmock
import eopayment
import pytest
from eopayment.mollie import Payment
from httmock import remember_called, response, urlmatch, with_httmock
WEBHOOK_URL = 'https://callback.example.com'
RETURN_URL = 'https://return.example.com'

View File

@ -15,19 +15,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import codecs
from unittest import TestCase
from decimal import Decimal
import base64
from unittest import mock
from six.moves.urllib import parse as urllib
import codecs
from decimal import Decimal
from unittest import TestCase, mock
from xml.etree import ElementTree as ET
import pytest
from six.moves.urllib import parse as urllib
import eopayment.paybox as paybox
import eopayment
import eopayment.paybox as paybox
BACKEND_PARAMS = {
'platform': 'test',

View File

@ -18,20 +18,17 @@
import datetime
import json
import lxml.etree as ET
from unittest import mock
import pytz
import httmock
import lxml.etree as ET
import pytest
import pytz
from zeep.plugins import HistoryPlugin
import eopayment
from eopayment.payfip_ws import PayFiP, PayFiPError, normalize_objet
NUMCLI = '090909'
NOTIF_URL = 'https://notif.payfip.example.com/'
REDIRECT_URL = 'https://redirect.payfip.example.com/'

View File

@ -19,7 +19,6 @@
import json
import pytest
import zeep.transports
import eopayment

View File

@ -15,9 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import eopayment
import pytest
import eopayment
def test_build_request():
backend = eopayment.Payment('sips2', {})

View File

@ -21,8 +21,8 @@ import pytest
from six.moves.urllib import parse as urlparse
import eopayment
from eopayment.systempayv2 import Payment, VADS_CUST_FIRST_NAME, VADS_CUST_LAST_NAME, PAID
from eopayment import ResponseError
from eopayment.systempayv2 import PAID, VADS_CUST_FIRST_NAME, VADS_CUST_LAST_NAME, Payment
PARAMS = {
'secret_test': '1122334455667788',

View File

@ -16,13 +16,13 @@
import datetime
from decimal import Decimal
from six.moves.urllib.parse import urlparse, parse_qs
import pytest
import pytz
from six.moves.urllib.parse import parse_qs, urlparse
import eopayment
import eopayment.tipi
import pytest
def test_tipi():