Skip to content

Commit 04fea7c

Browse files
committed
chore: Fix unit tests
1 parent 3fe904a commit 04fea7c

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

packages/toolbox-core/tests/test_sync_tool.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,21 @@ def test_toolbox_sync_tool_underscore_bound_params_property(
155155
assert toolbox_sync_tool._bound_params == mock_async_tool._bound_params
156156

157157

158-
def test_toolbox_sync_tool_underscore_required_auth_params_property(
158+
def test_toolbox_sync_tool_underscore_required_authn_params_property(
159159
toolbox_sync_tool: ToolboxSyncTool, mock_async_tool: MagicMock
160160
):
161-
"""Tests the _required_auth_params property."""
161+
"""Tests the _required_authn_params property."""
162162
assert (
163-
toolbox_sync_tool._required_auth_params == mock_async_tool._required_auth_params
163+
toolbox_sync_tool._required_authn_params == mock_async_tool._required_authn_params
164164
)
165165

166+
def test_toolbox_sync_tool_underscore_required_authz_tokens_property(
167+
toolbox_sync_tool: ToolboxSyncTool, mock_async_tool: MagicMock
168+
):
169+
"""Tests the _required_authz_tokens property."""
170+
assert (
171+
toolbox_sync_tool._required_authz_tokens == mock_async_tool._required_authz_tokens
172+
)
166173

167174
def test_toolbox_sync_tool_underscore_auth_service_token_getters_property(
168175
toolbox_sync_tool: ToolboxSyncTool, mock_async_tool: MagicMock

packages/toolbox-core/tests/test_tool.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,17 +575,27 @@ def test_toolbox_tool_underscore_bound_params_property(toolbox_tool: ToolboxTool
575575
bound_params["new_param"] = "new_value"
576576

577577

578-
def test_toolbox_tool_underscore_required_auth_params_property(
578+
def test_toolbox_tool_underscore_required_authn_params_property(
579579
toolbox_tool: ToolboxTool,
580580
):
581-
"""Tests the _required_auth_params property returns an immutable MappingProxyType."""
582-
required_auth_params = toolbox_tool._required_auth_params
583-
assert required_auth_params == {"message": ["service_a"]}
584-
assert isinstance(required_auth_params, MappingProxyType)
581+
"""Tests the _required_authn_params property returns an immutable MappingProxyType."""
582+
required_authn_params = toolbox_tool._required_authn_params
583+
assert required_authn_params == {"message": ["service_a"]}
584+
assert isinstance(required_authn_params, MappingProxyType)
585585
# Verify immutability
586586
with pytest.raises(TypeError):
587-
required_auth_params["new_param"] = ["new_service"]
587+
required_authn_params["new_param"] = ["new_service"]
588588

589+
def test_toolbox_tool_underscore_required_authz_tokens_property(
590+
toolbox_tool: ToolboxTool,
591+
):
592+
"""Tests the _required_authz_tokens property returns an immutable MappingProxyType."""
593+
required_authz_tokens = toolbox_tool._required_authz_tokens
594+
assert required_authz_tokens == ("service_b",)
595+
assert isinstance(required_authz_tokens, tuple)
596+
# Verify immutability
597+
with pytest.raises(TypeError):
598+
required_authz_tokens[0] = "new_service"
589599

590600
def test_toolbox_tool_underscore_auth_service_token_getters_property(
591601
toolbox_tool: ToolboxTool,

0 commit comments

Comments
 (0)