mirror of
https://github.com/Hopiu/python-markdown-oembed.git
synced 2026-04-13 19:31:00 +00:00
version bump
This commit is contained in:
parent
8da615da30
commit
3b29ca3252
2 changed files with 10 additions and 5 deletions
2
setup.py
2
setup.py
|
|
@ -6,7 +6,7 @@ except ImportError:
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
||||||
|
|
||||||
VERSION = '0.1.1'
|
VERSION = '0.1.2'
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
|
|
||||||
13
tests.py
13
tests.py
|
|
@ -2,6 +2,7 @@
|
||||||
import re
|
import re
|
||||||
import unittest
|
import unittest
|
||||||
import markdown
|
import markdown
|
||||||
|
from mock import patch
|
||||||
from mdx_oembed.extension import OEMBED_LINK_RE
|
from mdx_oembed.extension import OEMBED_LINK_RE
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -49,6 +50,12 @@ class OEmbedExtensionTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.markdown = markdown.Markdown(extensions=['oembed'])
|
self.markdown = markdown.Markdown(extensions=['oembed'])
|
||||||
|
|
||||||
|
def assert_convert(self, text, expected):
|
||||||
|
with patch('oembed.OEmbedEndpoint') as MockOEmbedEndpoint:
|
||||||
|
MockOEmbedEndpoint.get.return_value = expected
|
||||||
|
output = self.markdown.convert(text)
|
||||||
|
self.assertEqual(output, expected)
|
||||||
|
|
||||||
|
|
||||||
class IgnoredTestCase(OEmbedExtensionTestCase):
|
class IgnoredTestCase(OEmbedExtensionTestCase):
|
||||||
"""
|
"""
|
||||||
|
|
@ -133,8 +140,7 @@ class LimitedOEmbedExtensionTestCase(unittest.TestCase):
|
||||||
"""
|
"""
|
||||||
text = ''
|
text = ''
|
||||||
expected = '<iframe width="459" height="344" src="http://www.youtube.com/embed/zqnh_YJBvOI?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>'
|
expected = '<iframe width="459" height="344" src="http://www.youtube.com/embed/zqnh_YJBvOI?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>'
|
||||||
output = self.markdown.convert(text)
|
self.assert_convert(text, expected)
|
||||||
self.assertEqual(output, expected)
|
|
||||||
|
|
||||||
def test_vimeo_link(self):
|
def test_vimeo_link(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -142,8 +148,7 @@ class LimitedOEmbedExtensionTestCase(unittest.TestCase):
|
||||||
"""
|
"""
|
||||||
text = ''
|
text = ''
|
||||||
expected = '<p><img alt="link" src="http://vimeo.com/52970271" /></p>'
|
expected = '<p><img alt="link" src="http://vimeo.com/52970271" /></p>'
|
||||||
output = self.markdown.convert(text)
|
self.assert_convert(text, expected)
|
||||||
self.assertEqual(output, expected)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue