1919from nemoguardrails .actions import action
2020from nemoguardrails .actions .output_mapping import (
2121 default_output_mapping ,
22- should_block_output ,
22+ is_output_blocked ,
2323)
2424
2525# Tests for default_output_mapping
@@ -70,21 +70,21 @@ def test_should_block_output_with_tuple_result_and_mapping():
7070 # Test should_block_output when the result is a tuple and the dummy mapping is used.
7171 # When the first element equals "block", we expect True.
7272 result = ("block" ,)
73- assert should_block_output (result , dummy_action ) is True
73+ assert is_output_blocked (result , dummy_action ) is True
7474
7575 # When the result is not "block", we expect False.
7676 result = ("allow" ,)
77- assert should_block_output (result , dummy_action ) is False
77+ assert is_output_blocked (result , dummy_action ) is False
7878
7979
8080def test_should_block_output_with_non_tuple_result_and_mapping ():
8181 # Test should_block_output when the result is not a tuple.
8282 # The function should wrap it into a tuple.
8383 result = "block"
84- assert should_block_output (result , dummy_action ) is True
84+ assert is_output_blocked (result , dummy_action ) is True
8585
8686 result = "allow"
87- assert should_block_output (result , dummy_action ) is False
87+ assert is_output_blocked (result , dummy_action ) is False
8888
8989
9090def test_should_block_output_without_action_meta ():
@@ -98,9 +98,9 @@ def action_without_meta(res):
9898 del action_without_meta .action_meta
9999
100100 # Test with a boolean: default_output_mapping for True is False and for False is True.
101- assert should_block_output (True , action_without_meta ) is False
102- assert should_block_output (False , action_without_meta ) is True
101+ assert is_output_blocked (True , action_without_meta ) is False
102+ assert is_output_blocked (False , action_without_meta ) is True
103103
104104 # Test with a numeric value: block if < 0.5.
105- assert should_block_output (0.4 , action_without_meta ) is True
106- assert should_block_output (0.6 , action_without_meta ) is False
105+ assert is_output_blocked (0.4 , action_without_meta ) is True
106+ assert is_output_blocked (0.6 , action_without_meta ) is False
0 commit comments