def test_get_schema_returns_unavailable_schema_when_config_invalid(self):
        self.set_lti_tool_config(config_yaml='-invalid-')
        handler = oeditor.PopupHandler()
        handler.app_context = self.app_context
        tag = lti.LTIToolTag()

        self.assert_is_unavailable_schema(tag.get_schema(handler))
    def test_get_schema_returns_unavailable_schema_when_config_missing(self):
        self.set_lti_tool_config(config_yaml=lti._EMPTY_STRING)
        handler = oeditor.PopupHandler()
        handler.app_context = self.app_context
        tag = lti.LTIToolTag()

        self.assert_is_unavailable_schema(tag.get_schema(handler))
    def test_get_schema_returns_populated_schema_when_config_set_and_valid(
            self):
        self.set_lti_tool_config()
        handler = oeditor.PopupHandler()
        handler.app_context = self.app_context
        tag = lti.LTIToolTag()
        schema = tag.get_schema(handler)

        self.assertEqual('LTI Tool', schema.title)
        self.assertEqual(5, len(schema._properties))