22
33from starlette .routing import Mount
44
5- from ellar .auth .session import ISessionService
5+ from ellar .auth .session import ISessionStrategy
66from ellar .auth .session .strategy import SessionClientStrategy
77from ellar .common import Controller , delete , get , post
88from ellar .core import Request
@@ -32,7 +32,7 @@ def test_session():
3232 test_module = Test .create_test_module (
3333 controllers = [SessionSampleController ], config_module = dict (SECRET_KEY = "secret" )
3434 )
35- test_module .override_provider (ISessionService , use_class = SessionClientStrategy )
35+ test_module .override_provider (ISessionStrategy , use_class = SessionClientStrategy )
3636 client = test_module .get_test_client ()
3737
3838 response = client .get ("/" )
@@ -62,7 +62,7 @@ def test_session_expires():
6262 controllers = [SessionSampleController ],
6363 config_module = dict (SECRET_KEY = "secret" , SESSION_COOKIE_MAX_AGE = - 1 ),
6464 )
65- test_module .override_provider (ISessionService , use_class = SessionClientStrategy )
65+ test_module .override_provider (ISessionStrategy , use_class = SessionClientStrategy )
6666 client = test_module .get_test_client ()
6767
6868 response = client .post ("/" , json = {"some" : "data" })
@@ -84,7 +84,7 @@ def test_secure_session():
8484 controllers = [SessionSampleController ],
8585 config_module = dict (SECRET_KEY = "secret" , SESSION_COOKIE_SECURE = True ),
8686 )
87- test_module .override_provider (ISessionService , use_class = SessionClientStrategy )
87+ test_module .override_provider (ISessionStrategy , use_class = SessionClientStrategy )
8888 secure_client = test_module .get_test_client (base_url = "https://testserver" )
8989 unsecure_client = test_module .get_test_client (base_url = "http://testserver" )
9090
@@ -124,7 +124,7 @@ def test_session_cookie_sub_path():
124124 ],
125125 config_module = dict (SECRET_KEY = "secret" , SESSION_COOKIE_PATH = "/second_app" ),
126126 )
127- test_module .override_provider (ISessionService , use_class = SessionClientStrategy )
127+ test_module .override_provider (ISessionStrategy , use_class = SessionClientStrategy )
128128
129129 client_second_app = test_module .get_test_client (
130130 base_url = "http://testserver/second_app"
@@ -156,7 +156,7 @@ def test_invalid_session_cookie():
156156 test_module = Test .create_test_module (
157157 controllers = [SessionSampleController ], config_module = dict (SECRET_KEY = "secret" )
158158 )
159- test_module .override_provider (ISessionService , use_class = SessionClientStrategy )
159+ test_module .override_provider (ISessionStrategy , use_class = SessionClientStrategy )
160160 client = test_module .get_test_client ()
161161
162162 response = client .post ("/" , json = {"some" : "data" })
@@ -173,7 +173,7 @@ def test_session_cookie():
173173 controllers = [SessionSampleController ],
174174 config_module = dict (SECRET_KEY = "secret" , SESSION_COOKIE_MAX_AGE = None ),
175175 )
176- test_module .override_provider (ISessionService , use_class = SessionClientStrategy )
176+ test_module .override_provider (ISessionStrategy , use_class = SessionClientStrategy )
177177 client = test_module .get_test_client ()
178178
179179 response = client .post ("/" , json = {"some" : "data" })
0 commit comments