# Path: feincms3/embedding.py
# def embed(url, *, handlers=[embed_youtube, embed_vimeo]):
#     """embed(url, *, handlers=[embed_youtube, embed_vimeo])
#     Run a selection of embedding handlers and return the first value, or
#     ``None`` if URL couldn't be processed by any handler.
# 
#     You could write your own handler converting the URL argument into a plain
#     old anchor element or maybe even
#     :func:`feincms3.plugins.external.oembed_html` if you wanted to fall back to
#     oEmbed.
#     """
#     for handler in handlers:
#         html = handler(url)
#         if html is not None:
#             return html


from django.test import TestCase
from feincms3.embedding import embed



class EmbeddingTest(TestCase):
    def test_no_handlers(self):
        """Embed video without handlers"""
        self.assertEqual(embed("stuff"), None)

    def test_youtube(self):
        """YouTube video embedding works"""
        self.assertEqual(
            embed("https://www.youtube.com/watch?v=dQw4w9WgXcQ"),
            """\
<div class="responsive-embed widescreen youtube"><iframe \
src="https://www.youtube.com/embed/dQw4w9WgXcQ?rel=0" frameborder="0" \
allow="autoplay; fullscreen" allowfullscreen=""></iframe></div>""",
        )

        self.assertEqual(

# Path: feincms3/embedding.py
# def embed(url, *, handlers=[embed_youtube, embed_vimeo]):
#     """embed(url, *, handlers=[embed_youtube, embed_vimeo])
#     Run a selection of embedding handlers and return the first value, or
#     ``None`` if URL couldn't be processed by any handler.
# 
#     You could write your own handler converting the URL argument into a plain
#     old anchor element or maybe even
#     :func:`feincms3.plugins.external.oembed_html` if you wanted to fall back to
#     oEmbed.
#     """
#     for handler in handlers:
#         html = handler(url)
#         if html is not None:
#             return html


# Path: tests/testapp/test_embedding.py
from django.test import TestCase
from feincms3.embedding import embed




class EmbeddingTest(TestCase):
    def test_no_handlers(self):
        """Embed video without handlers"""
        self.assertEqual(embed("stuff"), None)

    def test_youtube(self):
        """YouTube video embedding works"""
        self.assertEqual(
            embed("https://www.youtube.com/watch?v=dQw4w9WgXcQ"),
            """\
<div class="responsive-embed widescreen youtube"><iframe \
src="https://www.youtube.com/embed/dQw4w9WgXcQ?rel=0" frameborder="0" \
allow="autoplay; fullscreen" allowfullscreen=""></iframe></div>""",
        )

        self.assertEqual(

            embed("https://youtu.be/y7-s5ZvC_2A"),