Skip to content

Commit 3edbc19

Browse files
eavanvalkenburgkojoru
authored andcommitted
Allow Python 3.5.3 as minimum. (#109)
* 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
1 parent 8b102ad commit 3edbc19

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ modules.xml
7171
/dist
7272
/MANIFEST
7373
/stripe.egg-info
74+
/bunq_env
75+
/.vscode
7476
.python-version
7577
*.pyc
7678
*.egg

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@
5656

5757
# Specify the Python versions you support here. In particular, ensure
5858
# that you indicate whether you support Python 2, Python 3 or both.
59+
'Programming Language :: Python :: 3.5',
5960
'Programming Language :: Python :: 3.6',
6061
],
6162

62-
# Require Python version equal or higher than Python 3.6.
63-
python_requires='>=3.6',
63+
# Require Python version equal or higher than the requested version.
64+
python_requires='>=3.5.3',
6465

6566
# Keywords related to the project
6667
keywords='open-banking sepa bunq finance api payment',

tests/model/generated/endpoint/test_monetary_account_bank.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from secrets import token_hex
1+
try:
2+
from secrets import token_hex
3+
except ImportError:
4+
from os import urandom
5+
6+
def token_hex():
7+
""" Function to replace import for Python < 3.6. """
8+
return urandom(16).hex()
29

310
from bunq.sdk.context import BunqContext
411
from bunq.sdk.model.generated.endpoint import MonetaryAccountBank

tests/model/generated/endpoint/test_monetary_account_joint.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ def test_monetary_account_joint_parser(self):
3737
with open(file_path, self._FILE_MODE_READ) as f:
3838
json_string = f.read()
3939

40-
joint_account: MonetaryAccountJoint = MonetaryAccountJoint.from_json(
41-
json_string
42-
)
40+
joint_account = MonetaryAccountJoint.from_json(json_string)
4341

42+
self.assertIsInstance(joint_account, MonetaryAccountJoint)
4443
self.assertIsNotNone(joint_account)
4544
self.assertIsNotNone(joint_account.all_co_owner)
4645

tests/model/generated/endpoint/test_payment.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def test_payment_batch(self):
5252
"""
5353
"""
5454

55-
response_create: endpoint.BunqResponseInt = \
56-
endpoint.PaymentBatch.create(
55+
response_create = endpoint.PaymentBatch.create(
5756
self.__create_payment_list()
5857
)
5958

59+
self.assertIsInstance(response_create, endpoint.BunqResponseInt)
6060
self.assertIsNotNone(response_create)
6161

62-
response_get: endpoint.BunqResponsePaymentBatch = \
63-
endpoint.PaymentBatch.get(response_create.value)
62+
response_get = endpoint.PaymentBatch.get(response_create.value)
6463

64+
self.assertIsInstance(response_get, endpoint.BunqResponsePaymentBatch)
6565
self.assertIsNotNone(response_get)
6666
self.assertFalse(response_get.value.is_all_field_none())
6767

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

73-
all_payment: List[endpoint.Payment] = []
73+
all_payment = []
7474

7575
while len(all_payment) < self._MAXIMUM_PAYMENT_IN_BATCH:
7676
all_payment.append(
@@ -84,4 +84,6 @@ def __create_payment_list(self) -> List[endpoint.Payment]:
8484
)
8585
)
8686

87+
self.assertIsInstance(all_payment, List)
88+
self.assertIsInstance(all_payment[0], endpoint.Payment)
8789
return all_payment

0 commit comments

Comments
 (0)