def test_get_security_config_returns_none_if_lti_key_missing(self): runtime = lti._get_runtime(self.app_context) self.assertIsNone(runtime.get_security_config('any'))
def test_get_security_config_returns_none_for_missing_key(self): self.set_lti_security_config() runtime = lti._get_runtime(self.app_context) self.assertIsNone(runtime.get_security_config('missing'))
def test_get_security_config_returns_existing_config(self): self.set_lti_security_config() runtime = lti._get_runtime(self.app_context) self.assertEqual( lti._SecurityConfig('key', 'secret'), runtime.get_security_config('key'))
def test_get_provider_enabled_true_if_enabled_for_deployment_and_course( self): self.enable_courses_can_enable_lti_provider() self.enable_lti_provider_for_course() runtime = lti._get_runtime(self.app_context) self.assertTrue(runtime.get_provider_enabled())
def test_get_provider_enabled_false_if_not_enabled_for_deployment(self): self.enable_lti_provider_for_course() config.Registry.test_overrides[ lti.COURSES_CAN_ENABLE_LTI_PROVIDER.name] = False runtime = lti._get_runtime(self.app_context) self.assertFalse(runtime.get_provider_enabled())
def test_get_provider_enabled_false_if_not_enabled_for_course(self): self.enable_courses_can_enable_lti_provider() runtime = lti._get_runtime(self.app_context) self.assertFalse(runtime.get_provider_enabled())
def test_constructor_raises_value_error_on_parse_error(self): self.set_lti_security_config(config_yaml='-invalid-') with self.assertRaises(ValueError): lti._get_runtime(self.app_context)