File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 44from aikido_zen .context import current_context , Context , get_current_context
55from aikido_zen .thread .thread_cache import ThreadCache , get_cache
66from . import should_block_request
7+ from .. import set_rate_limit_group
78
89
910@pytest .fixture (autouse = True )
@@ -36,6 +37,7 @@ def set_context(user=None, executed_middleware=False):
3637 "source" : "flask" ,
3738 "route" : "/posts/:id" ,
3839 "user" : user ,
40+ "rate_limit_group" : None ,
3941 "executed_middleware" : executed_middleware ,
4042 }
4143 ).set_as_current_context ()
@@ -75,6 +77,7 @@ def test_with_context_with_cache():
7577
7678def test_cache_comms_with_endpoints ():
7779 set_context (user = {"id" : "456" })
80+ set_rate_limit_group ("my_group" )
7881 thread_cache = get_cache ()
7982 thread_cache .config .blocked_uids = ["123" ]
8083 thread_cache .config .endpoints = [
@@ -145,7 +148,7 @@ def test_cache_comms_with_endpoints():
145148 "url" : "http://localhost:4000" ,
146149 },
147150 "user" : {"id" : "456" },
148- "group" : None ,
151+ "group" : "my_group" ,
149152 "remote_address" : "::1" ,
150153 },
151154 receive = True ,
You can’t perform that action at this time.
0 commit comments