Skip to content

Commit

Permalink
Simplify import of services
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbalakirev committed Oct 14, 2024
1 parent 50ebd60 commit 58726c5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/corbado_python_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
UserStatus,
UserUpdateReq,
)
from .services import IdentifierService, SessionService, UserService

__all__ = [
"SessionValidationResult",
Expand All @@ -26,4 +27,7 @@
"UserEntity",
"CorbadoSDK",
"Config",
"IdentifierService",
"SessionService",
"UserService",
]
11 changes: 7 additions & 4 deletions tests/integration/test_identifier_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

from typing_extensions import List

from corbado_python_sdk import CorbadoSDK, Identifier, IdentifierStatus, IdentifierType
from corbado_python_sdk.exceptions import ServerException
from corbado_python_sdk.generated.models.identifier_list import IdentifierList
from corbado_python_sdk.services.implementation.identifier_service import (
from corbado_python_sdk import (
CorbadoSDK,
Identifier,
IdentifierService,
IdentifierStatus,
IdentifierType,
)
from corbado_python_sdk.exceptions import ServerException
from corbado_python_sdk.generated.models.identifier_list import IdentifierList
from tests.utils import TestUtils

CANNOT_BE_BLANK = "cannot be blank"
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/test_user_service.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import unittest

from corbado_python_sdk import CorbadoSDK, UserEntity, UserStatus
from corbado_python_sdk import CorbadoSDK, UserEntity, UserService, UserStatus
from corbado_python_sdk.exceptions import ServerException
from corbado_python_sdk.services.implementation import UserService
from tests.utils import TestUtils


Expand Down
12 changes: 7 additions & 5 deletions tests/unit/test_session_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
from jwt import encode
from pydantic import ValidationError

from corbado_python_sdk import Config, CorbadoSDK, SessionValidationResult
from corbado_python_sdk.services import SessionService
from corbado_python_sdk import (
Config,
CorbadoSDK,
SessionService,
SessionValidationResult,
)

TEST_NAME = "Test Name"
TEST_EMAIL = "[email protected]"
Expand Down Expand Up @@ -114,9 +118,7 @@ def _generate_jwt(cls, iss: str, exp: int, nbf: int) -> str:
class TestSessionService(TestBase):
def test_get_and_validate_short_session_value(self):
for valid, token in self._provide_jwts():
result: SessionValidationResult = self.session_service.get_and_validate_short_session_value(
short_session=token
)
result: SessionValidationResult = self.session_service.get_and_validate_short_session_value(short_session=token)

self.assertEqual(first=valid, second=result.authenticated)
self.assertEqual(first=valid, second=result.error is None)
Expand Down

0 comments on commit 58726c5

Please sign in to comment.