55from app .server import app
66from ellar .cache import CacheModule
77from ellar .cache .backends .local_cache import LocalMemCacheBackend
8- from ellar .core import TestClient , TestClientFactory
8+ from ellar .testing import Test , TestClient
99
1010from ellar_throttler import (
1111 CacheThrottlerStorageService ,
@@ -85,15 +85,15 @@ def test_default_controller_index(self):
8585
8686class TestSkipIfConfigure :
8787 def test_skip_configure (self ):
88- test_module = TestClientFactory .create_test_module (
88+ test_module = Test .create_test_module (
8989 modules = (
9090 ThrottlerModule .setup (limit = 5 , ttl = 100 , skip_if = lambda ctx : True ),
9191 ControllerModule ,
9292 ),
9393 global_guards = [ThrottlerGuard ],
9494 )
9595
96- _client = test_module .get_client ()
96+ _client = test_module .get_test_client ()
9797 for i in range (15 ):
9898 res = _client .get ("/" )
9999
@@ -106,7 +106,7 @@ def test_skip_configure(self):
106106
107107
108108class TestThrottlerStorageServiceConfiguration :
109- test_module_cache = TestClientFactory .create_test_module (
109+ test_module_cache = Test .create_test_module (
110110 modules = (
111111 ThrottlerModule .setup (
112112 limit = 5 , ttl = 100 , storage = CacheThrottlerStorageService
@@ -118,7 +118,7 @@ class TestThrottlerStorageServiceConfiguration:
118118 config_module = dict (CACHES = {"default" : LocalMemCacheBackend ()}),
119119 )
120120
121- test_module_use_value = TestClientFactory .create_test_module (
121+ test_module_use_value = Test .create_test_module (
122122 modules = (
123123 ThrottlerModule .setup (limit = 5 , ttl = 100 , storage = ThrottlerStorageService ()),
124124 ControllerModule ,
@@ -138,7 +138,7 @@ def request_for_limit(self, app_client, url, limit):
138138
139139 @pytest .mark .parametrize ("test_module" , [test_module_cache , test_module_use_value ])
140140 def test_limit_index (self , test_module ):
141- _client = test_module .get_client ()
141+ _client = test_module .get_test_client ()
142142
143143 for url , limit in [("/limit/" , 2 ), ("/limit/higher" , 5 )]:
144144 self .request_for_limit (_client , url , limit )
@@ -151,7 +151,7 @@ def test_limit_index(self, test_module):
151151
152152 @pytest .mark .parametrize ("test_module" , [test_module_cache , test_module_use_value ])
153153 def test_limit_get_shorter (self , test_module ):
154- _client = test_module .get_client ()
154+ _client = test_module .get_test_client ()
155155 limit , url = (
156156 5 ,
157157 "/limit/shorter" ,
@@ -167,7 +167,7 @@ def test_limit_get_shorter(self, test_module):
167167
168168 @pytest .mark .parametrize ("test_module" , [test_module_use_value ])
169169 def test_limit_get_shorter_cache_clear (self , test_module ):
170- _client = test_module .get_client ()
170+ _client = test_module .get_test_client ()
171171 limit , url = (
172172 5 ,
173173 "/limit/shorter-2" ,
0 commit comments