File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11"""Test for validate_scope fix when self.scope is None"""
2+
23import pytest
34from mcp .shared .auth import ClientRegistration , InvalidScopeError
45
@@ -11,7 +12,7 @@ def test_validate_scope_with_none_scope_allows_all():
1112 scope = None , # No scope restriction
1213 redirect_uris = ["http://localhost/callback" ],
1314 )
14-
15+
1516 # Should not raise - all scopes allowed when no restriction
1617 result = client .validate_scope ("read write admin" )
1718 assert result == ["read" , "write" , "admin" ]
@@ -25,7 +26,7 @@ def test_validate_scope_with_empty_requested_returns_none():
2526 scope = "read write" ,
2627 redirect_uris = ["http://localhost/callback" ],
2728 )
28-
29+
2930 result = client .validate_scope (None )
3031 assert result is None
3132
@@ -38,11 +39,11 @@ def test_validate_scope_with_restrictions_enforced():
3839 scope = "read write" ,
3940 redirect_uris = ["http://localhost/callback" ],
4041 )
41-
42+
4243 # Allowed scope
4344 result = client .validate_scope ("read" )
4445 assert result == ["read" ]
45-
46+
4647 # Disallowed scope should raise
4748 with pytest .raises (InvalidScopeError ):
4849 client .validate_scope ("admin" )
You can’t perform that action at this time.
0 commit comments