@@ -185,6 +185,17 @@ def test_outcome_service_url(self):
185185 self .xblock .runtime .handler_url .assert_called_with (self .xblock , 'outcome_service_handler' , thirdparty = True )
186186 self .assertEqual (url , handler_url )
187187
188+ def test_result_service_url (self ):
189+ """
190+ Test `result_service_url` calls `runtime.handler_url` with thirdparty kwarg
191+ """
192+ handler_url = 'http://localhost:8005/result_service_handler'
193+ self .xblock .runtime .handler_url = Mock (return_value = "{}/?" .format (handler_url ))
194+ url = self .xblock .result_service_url
195+
196+ self .xblock .runtime .handler_url .assert_called_with (self .xblock , 'result_service_handler' , thirdparty = True )
197+ self .assertEqual (url , handler_url )
198+
188199 def test_prefixed_custom_parameters (self ):
189200 """
190201 Test `prefixed_custom_parameters` appropriately prefixes the configured custom params
@@ -528,6 +539,39 @@ def test_delete_result_called(self, mock_parse_suffix, mock_delete_result):
528539 assert mock_delete_result .called
529540 self .assertEqual (response .status_code , 200 )
530541
542+ def test_get_outcome_service_url_with_default_parameter (self ):
543+ """
544+ Test `get_outcome_service_url` with default parameter
545+ """
546+ handler_url = 'http://localhost:8005/outcome_service_handler'
547+ self .xblock .runtime .handler_url = Mock (return_value = "{}/?" .format (handler_url ))
548+ url = self .xblock .get_outcome_service_url ()
549+
550+ self .xblock .runtime .handler_url .assert_called_with (self .xblock , 'outcome_service_handler' , thirdparty = True )
551+ self .assertEqual (url , handler_url )
552+
553+ def test_get_outcome_service_url_with_service_name_grade_handler (self ):
554+ """
555+ Test `get_outcome_service_url` calls service name grade_handler
556+ """
557+ handler_url = 'http://localhost:8005/outcome_service_handler'
558+ self .xblock .runtime .handler_url = Mock (return_value = "{}/?" .format (handler_url ))
559+ url = self .xblock .get_outcome_service_url ('grade_handler' )
560+
561+ self .xblock .runtime .handler_url .assert_called_with (self .xblock , 'outcome_service_handler' , thirdparty = True )
562+ self .assertEqual (url , handler_url )
563+
564+ def test_get_outcome_service_url_with_service_name_lti_2_0_result_rest_handler (self ):
565+ """
566+ Test `get_outcome_service_url` calls with service name lti_2_0_result_rest_handler
567+ """
568+ handler_url = 'http://localhost:8005/result_service_handler'
569+ self .xblock .runtime .handler_url = Mock (return_value = "{}/?" .format (handler_url ))
570+ url = self .xblock .get_outcome_service_url ('lti_2_0_result_rest_handler' )
571+
572+ self .xblock .runtime .handler_url .assert_called_with (self .xblock , 'result_service_handler' , thirdparty = True )
573+ self .assertEqual (url , handler_url )
574+
531575
532576class TestMaxScore (TestLtiConsumerXBlock ):
533577 """
0 commit comments