55
66from django .test import TestCase
77
8- from ..exceptions import HookFilterException
8+ from ..exceptions import OpenEdxFilterException
99from ..pipeline import run_pipeline
1010
1111
@@ -54,7 +54,7 @@ def test_run_empty_pipeline(self, get_functions_mock, get_configuration_mock):
5454 def test_raise_hook_exception (self , get_functions_mock , get_configuration_mock ):
5555 """
5656 This method runs a pipeline with a function that raises
57- HookFilterException . This means that fail_silently must be set to
57+ OpenEdxFilterException . This means that fail_silently must be set to
5858 False.
5959
6060 Expected behavior:
@@ -65,14 +65,14 @@ def test_raise_hook_exception(self, get_functions_mock, get_configuration_mock):
6565 "fail_silently" : False ,
6666 }
6767 exception_message = "There was an error executing filter X."
68- function = Mock (side_effect = HookFilterException (message = exception_message ))
68+ function = Mock (side_effect = OpenEdxFilterException (message = exception_message ))
6969 function .__name__ = "function_name"
7070 get_functions_mock .return_value = [function ]
71- log_message = "Exception raised while running '{func_name}':\n HookFilterException : {exc_msg}" .format (
71+ log_message = "Exception raised while running '{func_name}':\n OpenEdxFilterException : {exc_msg}" .format (
7272 func_name = "function_name" , exc_msg = exception_message ,
7373 )
7474
75- with self .assertRaises (HookFilterException ), self .assertLogs () as captured :
75+ with self .assertRaises (OpenEdxFilterException ), self .assertLogs () as captured :
7676 run_pipeline (self .hook_name , ** self .kwargs )
7777 self .assertEqual (
7878 captured .records [0 ].getMessage (), log_message ,
@@ -83,7 +83,7 @@ def test_raise_hook_exception(self, get_functions_mock, get_configuration_mock):
8383 def test_not_raise_hook_exception (self , get_functions_mock , get_hook_config_mock ):
8484 """
8585 This method runs a pipeline with a function that raises
86- HookFilterException but raise_exception is set to False. This means
86+ OpenEdxFilterException but raise_exception is set to False. This means
8787 fail_silently must be set to True or not defined.
8888
8989 Expected behavior:
@@ -96,7 +96,7 @@ def test_not_raise_hook_exception(self, get_functions_mock, get_hook_config_mock
9696 return_value = {
9797 "request" : Mock (),
9898 }
99- function_with_exception = Mock (side_effect = HookFilterException )
99+ function_with_exception = Mock (side_effect = OpenEdxFilterException )
100100 function_without_exception = Mock (return_value = return_value )
101101 get_functions_mock .return_value = [
102102 function_with_exception ,
0 commit comments