Skip to content

Commit 58726c5

Browse files
committed
Simplify import of services
1 parent 50ebd60 commit 58726c5

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

src/corbado_python_sdk/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
UserStatus,
1313
UserUpdateReq,
1414
)
15+
from .services import IdentifierService, SessionService, UserService
1516

1617
__all__ = [
1718
"SessionValidationResult",
@@ -26,4 +27,7 @@
2627
"UserEntity",
2728
"CorbadoSDK",
2829
"Config",
30+
"IdentifierService",
31+
"SessionService",
32+
"UserService",
2933
]

tests/integration/test_identifier_service.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33

44
from typing_extensions import List
55

6-
from corbado_python_sdk import CorbadoSDK, Identifier, IdentifierStatus, IdentifierType
7-
from corbado_python_sdk.exceptions import ServerException
8-
from corbado_python_sdk.generated.models.identifier_list import IdentifierList
9-
from corbado_python_sdk.services.implementation.identifier_service import (
6+
from corbado_python_sdk import (
7+
CorbadoSDK,
8+
Identifier,
109
IdentifierService,
10+
IdentifierStatus,
11+
IdentifierType,
1112
)
13+
from corbado_python_sdk.exceptions import ServerException
14+
from corbado_python_sdk.generated.models.identifier_list import IdentifierList
1215
from tests.utils import TestUtils
1316

1417
CANNOT_BE_BLANK = "cannot be blank"

tests/integration/test_user_service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import unittest
22

3-
from corbado_python_sdk import CorbadoSDK, UserEntity, UserStatus
3+
from corbado_python_sdk import CorbadoSDK, UserEntity, UserService, UserStatus
44
from corbado_python_sdk.exceptions import ServerException
5-
from corbado_python_sdk.services.implementation import UserService
65
from tests.utils import TestUtils
76

87

tests/unit/test_session_service.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
from jwt import encode
88
from pydantic import ValidationError
99

10-
from corbado_python_sdk import Config, CorbadoSDK, SessionValidationResult
11-
from corbado_python_sdk.services import SessionService
10+
from corbado_python_sdk import (
11+
Config,
12+
CorbadoSDK,
13+
SessionService,
14+
SessionValidationResult,
15+
)
1216

1317
TEST_NAME = "Test Name"
1418
TEST_EMAIL = "test@email.com"
@@ -114,9 +118,7 @@ def _generate_jwt(cls, iss: str, exp: int, nbf: int) -> str:
114118
class TestSessionService(TestBase):
115119
def test_get_and_validate_short_session_value(self):
116120
for valid, token in self._provide_jwts():
117-
result: SessionValidationResult = self.session_service.get_and_validate_short_session_value(
118-
short_session=token
119-
)
121+
result: SessionValidationResult = self.session_service.get_and_validate_short_session_value(short_session=token)
120122

121123
self.assertEqual(first=valid, second=result.authenticated)
122124
self.assertEqual(first=valid, second=result.error is None)

0 commit comments

Comments
 (0)