88
99pytestmark = [pytest .mark .tier1 , pytest .mark .cpu ]
1010
11- NAMESPACE = ns_from_file (__file__ )
11+ NAMESPACE = ns_from_file (file = __file__ )
1212
1313
1414@pytest .mark .parametrize (
@@ -32,9 +32,11 @@ def test_llmisvc_authorized(self, llmisvc_auth_pair):
3232 expected = "rome"
3333
3434 for entry in [entry_a , entry_b ]:
35- status , body = send_chat_completions (entry .service , prompt = prompt , token = entry .token , insecure = False )
35+ status , body = send_chat_completions (
36+ llmisvc = entry .service , prompt = prompt , token = entry .token , insecure = False
37+ )
3638 assert status == 200 , f"Authorized request failed with { status } : { body } "
37- completion = parse_completion_text (body )
39+ completion = parse_completion_text (response_body = body )
3840 assert expected in completion .lower (), f"Expected '{ expected } ' in response, got: { completion } "
3941
4042 def test_llmisvc_unauthorized (self , llmisvc_auth_pair ):
@@ -49,10 +51,17 @@ def test_llmisvc_unauthorized(self, llmisvc_auth_pair):
4951
5052 # User B's token cannot access user A's service
5153 status , _ = send_chat_completions (
52- entry_a .service , prompt = "What is the capital of Italy?" , token = entry_b .token , insecure = False
54+ llmisvc = entry_a .service ,
55+ prompt = "What is the capital of Italy?" ,
56+ token = entry_b .token ,
57+ insecure = False ,
5358 )
5459 assert status in (401 , 403 ), f"Cross-user access should be denied, got { status } "
5560
5661 # No token at all fails
57- status , _ = send_chat_completions (entry_a .service , prompt = "What is the capital of Italy?" , insecure = False )
62+ status , _ = send_chat_completions (
63+ llmisvc = entry_a .service ,
64+ prompt = "What is the capital of Italy?" ,
65+ insecure = False ,
66+ )
5867 assert status in (401 , 403 ), f"No-token access should be denied, got { status } "
0 commit comments