Skip to content

Commit 3ac41ff

Browse files
author
Pascal Wink
committed
remove unwanted changes
1 parent 29913ff commit 3ac41ff

File tree

6 files changed

+5
-99
lines changed

6 files changed

+5
-99
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@ venv
8181

8282
tests/assets/bunq-oauth-psd2-test.conf
8383
tests/assets/bunq-psd2-test.conf
84+
tests/assets/key.pem
85+
tests/assets/certificate.pem
86+

bunq/sdk/json/converter.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,50 +250,39 @@ def _str_to_type_from_member_module(cls,
250250
"""
251251
:raise: BunqException when could not find the class for the string.
252252
"""
253-
# Handle the case where string doesn't contain a dot
254253
if cls._DELIMITER_MODULE not in string:
255-
# Try direct lookup in current module
256254
if hasattr(module_, string):
257255
return getattr(module_, string)
258256

259-
# Check module type and try appropriate suffix
260257
if "object_" in module_.__name__:
261-
# For object_ modules, try with Object suffix
262258
obj_name = string + "Object"
263259
if hasattr(module_, obj_name):
264260
return getattr(module_, obj_name)
265261
elif "endpoint" in module_.__name__:
266-
# For endpoint modules, try with ApiObject suffix
267262
api_name = string + "ApiObject"
268263
if hasattr(module_, api_name):
269264
return getattr(module_, api_name)
270265
else:
271-
# For other modules, try ApiObject suffix as default
272266
api_name = string + "ApiObject"
273267
if hasattr(module_, api_name):
274268
return getattr(module_, api_name)
275269

276-
# If not found, fallback to legacy behavior with appropriate error
277270
error_message = cls._ERROR_COULD_NOT_FIND_CLASS.format(string)
278271
raise BunqException(error_message)
279272

280-
# Original behavior for strings with dots
281273
module_name_short, class_name = string.split(cls._DELIMITER_MODULE)
282274
members = inspect.getmembers(module_, inspect.ismodule)
283275

284276
for name, module_member in members:
285277
if module_name_short == name:
286-
# Try original class name first
287278
if hasattr(module_member, class_name):
288279
return getattr(module_member, class_name)
289280

290-
# If "object_" module, try with Object suffix
291281
if "object_" in module_member.__name__:
292282
obj_name = class_name + "Object"
293283
if hasattr(module_member, obj_name):
294284
return getattr(module_member, obj_name)
295285

296-
# If "endpoint" module, try with ApiObject suffix
297286
if "endpoint" in module_member.__name__:
298287
api_name = class_name + "ApiObject"
299288
if hasattr(module_member, api_name):
@@ -323,8 +312,6 @@ def _deserialize_list(cls,
323312

324313
return list_deserialized
325314

326-
327-
328315
@classmethod
329316
def _fill_default_values(cls,
330317
cls_context: Type[T],

tests/assets/cert.pem

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/assets/certChain.pem

Whitespace-only changes.

tests/assets/key.pem

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/context/test_psd2_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class TestPsd2Context(unittest.TestCase):
1717
_FILE_TEST_CONFIGURATION = '/assets/bunq-psd2-test.conf'
1818
_FILE_TEST_OAUTH = '/assets/bunq-oauth-psd2-test.conf'
1919

20-
_FILE_TEST_CERTIFICATE = '/assets/cert.pem'
21-
_FILE_TEST_CERTIFICATE_CHAIN = '/assets/certChain.pem'
20+
_FILE_TEST_CERTIFICATE = '/assets/certificate.pem'
21+
_FILE_TEST_CERTIFICATE_CHAIN = '/assets/certificate.pem'
2222
_FILE_TEST_PRIVATE_KEY = '/assets/key.pem'
2323

2424
_TEST_DEVICE_DESCRIPTION = 'PSD2TestDevice'

0 commit comments

Comments
 (0)