mirror of
https://github.com/Hopiu/python-markdown-oembed.git
synced 2026-03-16 22:10:24 +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
|
||||
|
||||
|
||||
VERSION = '0.1.1'
|
||||
VERSION = '0.1.2'
|
||||
|
||||
|
||||
setup(
|
||||
|
|
|
|||
13
tests.py
13
tests.py
|
|
@ -2,6 +2,7 @@
|
|||
import re
|
||||
import unittest
|
||||
import markdown
|
||||
from mock import patch
|
||||
from mdx_oembed.extension import OEMBED_LINK_RE
|
||||
|
||||
|
||||
|
|
@ -49,6 +50,12 @@ class OEmbedExtensionTestCase(unittest.TestCase):
|
|||
def setUp(self):
|
||||
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):
|
||||
"""
|
||||
|
|
@ -133,8 +140,7 @@ class LimitedOEmbedExtensionTestCase(unittest.TestCase):
|
|||
"""
|
||||
text = ''
|
||||
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.assertEqual(output, expected)
|
||||
self.assert_convert(text, expected)
|
||||
|
||||
def test_vimeo_link(self):
|
||||
"""
|
||||
|
|
@ -142,8 +148,7 @@ class LimitedOEmbedExtensionTestCase(unittest.TestCase):
|
|||
"""
|
||||
text = ''
|
||||
expected = '<p><img alt="link" src="http://vimeo.com/52970271" /></p>'
|
||||
output = self.markdown.convert(text)
|
||||
self.assertEqual(output, expected)
|
||||
self.assert_convert(text, expected)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in a new issue