Skip to content

Commit

Permalink
Allow Python 3.5.3 as minimum. (#109)
Browse files Browse the repository at this point in the history
* changed version, python v, some edits in tests

* final edit

* added docstring

* reverted versions and cleaned up

* deleted vscode file

* whitespaces deleted

* updated setup.py
  • Loading branch information
eavanvalkenburg authored and kojoru committed Oct 24, 2018
1 parent 8b102ad commit 3edbc19
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ modules.xml
/dist
/MANIFEST
/stripe.egg-info
/bunq_env
/.vscode
.python-version
*.pyc
*.egg
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],

# Require Python version equal or higher than Python 3.6.
python_requires='>=3.6',
# Require Python version equal or higher than the requested version.
python_requires='>=3.5.3',

# Keywords related to the project
keywords='open-banking sepa bunq finance api payment',
Expand Down
9 changes: 8 additions & 1 deletion tests/model/generated/endpoint/test_monetary_account_bank.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from secrets import token_hex
try:
from secrets import token_hex
except ImportError:
from os import urandom

def token_hex():
""" Function to replace import for Python < 3.6. """
return urandom(16).hex()

from bunq.sdk.context import BunqContext
from bunq.sdk.model.generated.endpoint import MonetaryAccountBank
Expand Down
5 changes: 2 additions & 3 deletions tests/model/generated/endpoint/test_monetary_account_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ def test_monetary_account_joint_parser(self):
with open(file_path, self._FILE_MODE_READ) as f:
json_string = f.read()

joint_account: MonetaryAccountJoint = MonetaryAccountJoint.from_json(
json_string
)
joint_account = MonetaryAccountJoint.from_json(json_string)

self.assertIsInstance(joint_account, MonetaryAccountJoint)
self.assertIsNotNone(joint_account)
self.assertIsNotNone(joint_account.all_co_owner)

Expand Down
12 changes: 7 additions & 5 deletions tests/model/generated/endpoint/test_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ def test_payment_batch(self):
"""
"""

response_create: endpoint.BunqResponseInt = \
endpoint.PaymentBatch.create(
response_create = endpoint.PaymentBatch.create(
self.__create_payment_list()
)

self.assertIsInstance(response_create, endpoint.BunqResponseInt)
self.assertIsNotNone(response_create)

response_get: endpoint.BunqResponsePaymentBatch = \
endpoint.PaymentBatch.get(response_create.value)
response_get = endpoint.PaymentBatch.get(response_create.value)

self.assertIsInstance(response_get, endpoint.BunqResponsePaymentBatch)
self.assertIsNotNone(response_get)
self.assertFalse(response_get.value.is_all_field_none())

Expand All @@ -70,7 +70,7 @@ def __create_payment_list(self) -> List[endpoint.Payment]:
:rtype: List[Payment]
"""

all_payment: List[endpoint.Payment] = []
all_payment = []

while len(all_payment) < self._MAXIMUM_PAYMENT_IN_BATCH:
all_payment.append(
Expand All @@ -84,4 +84,6 @@ def __create_payment_list(self) -> List[endpoint.Payment]:
)
)

self.assertIsInstance(all_payment, List)
self.assertIsInstance(all_payment[0], endpoint.Payment)
return all_payment

0 comments on commit 3edbc19

Please sign in to comment.