from oembed.constants import OEMBED_TEXT_PARSER, OEMBED_HTML_PARSER from oembed.utils import load_class text_parser = load_class(OEMBED_TEXT_PARSER) html_parser = load_class(OEMBED_HTML_PARSER)
def test_load_class(self): parser_class = load_class('oembed.parsers.html.HTMLParser') self.assertEqual(parser_class.__name__, 'HTMLParser') self.assertEqual(parser_class.__module__, 'oembed.parsers.html')
from oembed.constants import OEMBED_IMAGE_PROCESSOR from oembed.utils import load_class image_processor = load_class(OEMBED_IMAGE_PROCESSOR)