Skip to content

Commit 5647827

Browse files
author
Kevin Hellemun
committed
Modified imports to prevent circular dependency. (#40)
1 parent b38028b commit 5647827

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

bunq/sdk/model/core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from bunq.sdk import client
2-
from bunq.sdk import context
32
from bunq.sdk.json import converter
43

54

@@ -269,7 +268,7 @@ def server_public_key(self):
269268
@classmethod
270269
def create(cls, api_context, public_key_string):
271270
"""
272-
:type api_context: context.ApiContext
271+
:type api_context: bunq.sdk.context.ApiContext
273272
:type public_key_string: str
274273
275274
:rtype: client.BunqResponse[Installation]
@@ -353,7 +352,7 @@ def user_company(self):
353352
@classmethod
354353
def create(cls, api_context):
355354
"""
356-
:type api_context: context.ApiContext
355+
:type api_context: bunq.sdk.context.ApiContext
357356
358357
:rtype: client.BunqResponse[SessionServer]
359358
"""

tests/bunq_test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import os
22
import unittest
33

4-
from tests.config import Config
5-
from bunq.sdk.context import ApiContext
6-
from bunq.sdk.context import ApiEnvironmentType
4+
from tests import config
5+
from bunq.sdk import context
76

87

98
class BunqSdkTestCase(unittest.TestCase):
109
# Config values
11-
_API_KEY = Config.get_api_key()
10+
_API_KEY = config.Config.get_api_key()
1211

1312
# Name of bunq config file
1413
_FILENAME_BUNQ_CONFIG = "/bunq-test.conf"
@@ -20,21 +19,21 @@ class BunqSdkTestCase(unittest.TestCase):
2019
def _get_api_context(cls):
2120
"""
2221
Calls IsSessionActive to check if the session token is still active
23-
and returns the ApiContext.
22+
and returns the context.ApiContext.
2423
2524
Catches ApiException if the session is inactive.
2625
Catches BunqException if the conf file does not exist.
2726
28-
:rtype: ApiContext
27+
:rtype: context.ApiContext
2928
"""
3029

3130
filename_bunq_config_full = (cls._get_directory_test_root() +
3231
cls._FILENAME_BUNQ_CONFIG)
3332

3433
try:
35-
api_context = ApiContext.restore(filename_bunq_config_full)
34+
api_context = context.ApiContext.restore(filename_bunq_config_full)
3635
except FileNotFoundError:
37-
api_context = ApiContext(ApiEnvironmentType.SANDBOX, cls._API_KEY,
36+
api_context = context.ApiContext(context.ApiEnvironmentType.SANDBOX, cls._API_KEY,
3837
cls._DEVICE_DESCRIPTION, [])
3938
else:
4039
api_context.ensure_session_active()

tests/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import os
33

4-
from bunq.sdk.model.generated.object_ import Pointer
4+
from bunq.sdk.model.generated import object_
55

66

77
class Config:
@@ -104,7 +104,7 @@ def get_pointer_counter_party_self(cls):
104104
alias = cls._get_config_file()[cls._FIELD_COUNTER_PARTY_SELF][
105105
cls._FIELD_ALIAS]
106106

107-
return Pointer(type_, alias)
107+
return object_.Pointer(type_, alias)
108108

109109
@classmethod
110110
def get_pointer_counter_party_other(cls):
@@ -117,7 +117,7 @@ def get_pointer_counter_party_other(cls):
117117
alias = cls._get_config_file()[cls._FIELD_COUNTER_PARTY_OTHER][
118118
cls._FIELD_ALIAS]
119119

120-
return Pointer(type_, alias)
120+
return object_.Pointer(type_, alias)
121121

122122
@classmethod
123123
def get_permitted_ips(cls):

tests/test_pagination_scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from bunq.sdk.model.generated import endpoint
44
from bunq.sdk.model.generated import object_
55
from tests.bunq_test import BunqSdkTestCase
6-
from tests.bunq_test import Config
6+
from tests.config import Config
77

88

99
class TestPaginationScenario(BunqSdkTestCase):

0 commit comments

Comments
 (0)