Have a look at the farm of Jakob Zinsstag’s cousin in the Canton of Jura,
+Switzerland. Different animals create different feelings: there are those we
+love, some provoke fears and others will be eaten. Jakob Zinsstag shares the
+personal experiences he has had with animals.
+
How do you categorise your own experience with animals?
diff --git a/src/python_markdown_oembed_extension/tests/test_markdown.md b/src/python_markdown_oembed_extension/tests/test_markdown.md
new file mode 100644
index 0000000..107b350
--- /dev/null
+++ b/src/python_markdown_oembed_extension/tests/test_markdown.md
@@ -0,0 +1,12 @@
+In this video Jakob Zinsstag introduces the topic of the course. You will
+discover that the relationship between humans and animals is manifold.
+{.lead}
+
+
+
+Have a look at the farm of Jakob Zinsstag’s cousin in the Canton of Jura,
+Switzerland. Different animals create different feelings: there are those we
+love, some provoke fears and others will be eaten. Jakob Zinsstag shares the
+personal experiences he has had with animals.
+
+**How do you categorise your own experience with animals?**
diff --git a/src/python_markdown_oembed_extension/tests/test_markdown.py b/src/python_markdown_oembed_extension/tests/test_markdown.py
new file mode 100644
index 0000000..4391235
--- /dev/null
+++ b/src/python_markdown_oembed_extension/tests/test_markdown.py
@@ -0,0 +1,21 @@
+import markdown, yaml, requests_mock
+from python_markdown_oembed_extension.oembedextension import OEmbedExtension
+from python_markdown_oembed_extension.endpoints import VIMEO
+
+
+def test_full():
+ with ( requests_mock.Mocker() as m
+ , open('./src/python_markdown_oembed_extension/tests/vimeoMock.yaml', 'r') as vm
+ , open('./src/python_markdown_oembed_extension/tests/test_markdown.md', 'r') as md
+ , open('./src/python_markdown_oembed_extension/tests/test_expectedHtml.html', 'r') as expectedHtml
+ ):
+
+ yml = yaml.safe_load(vm)
+ m.get(yml['request'], json=yml['response'])
+
+ mdString = md.read()
+ htmlString = markdown.markdown(mdString, extensions=[OEmbedExtension()])
+ print(htmlString)
+
+ assert htmlString == expectedHtml.read().rstrip()
+
diff --git a/src/python_markdown_oembed_extension/tests/vimeoMock.yaml b/src/python_markdown_oembed_extension/tests/vimeoMock.yaml
new file mode 100644
index 0000000..4559214
--- /dev/null
+++ b/src/python_markdown_oembed_extension/tests/vimeoMock.yaml
@@ -0,0 +1,30 @@
+---
+request: 'https://vimeo.com/734276368/f29c542352'
+response:
+ account_type: 'live_premium'
+ author_name: 'NMC Universität Basel'
+ author_url: 'https://vimeo.com/newmediacenterunibasel'
+ description: ''
+ duration: 282
+ height: 240
+ html: >-
+
+ is_plus: '0'
+ provider_name: 'Vimeo'
+ provider_url: 'https://vimeo.com/'
+ thumbnail_height: 166
+ thumbnail_url: 'https://i.vimeocdn.com/video/1480489232-5ca2d723cadc09ae077c8b437581e84bd0485049780c60e218986fda60881110-d_295x166'
+ thumbnail_url_with_play_button: 'https://i.vimeocdn.com/filter/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1480489232-5ca2d723cadc09ae077c8b437581e84bd0485049780c60e218986fda60881110-d_295x166&src1=http%3A%2F%2Ff.vimeocdn.com%2Fp%2Fimages%2Fcrawler_play.png'
+ thumbnail_width: 295
+ title: 'One-Health_Tales_EN_1-02'
+ type: 'video'
+ upload_date: '2022-07-28 04:16:03'
+ uri: '/videos/734276368:f29c542352'
+ version: '1.0'
+ video_id: 734276368
+ width: 426
diff --git a/tests.py b/tests.py
deleted file mode 100644
index 8cc8aad..0000000
--- a/tests.py
+++ /dev/null
@@ -1,192 +0,0 @@
-# -*- coding: utf-8 -*-
-import re
-import unittest
-import markdown
-from mock import patch
-from nose.plugins.skip import SkipTest
-from mdx_oembed.extension import OEMBED_LINK_RE
-from mdx_oembed import endpoints
-
-
-class OEmbedPatternRegexTestCase(unittest.TestCase):
- def setUp(self):
- self.re = re.compile(OEMBED_LINK_RE)
-
- def test_ignore_relative_image_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNone(match)
-
- def test_ignore_absolute_image_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNone(match)
-
- def test_ignore_png_image_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNone(match)
-
- def test_ignore_jpg_image_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNone(match)
-
- def test_ignore_gif_image_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNone(match)
-
- def test_find_youtube_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNotNone(match)
-
- def test_find_youtube_short_link(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNotNone(match)
-
- def test_find_youtube_http(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNotNone(match)
-
- def test_find_youtube_https(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNotNone(match)
-
- def test_find_youtube_auto(self):
- text = ''
- match = self.re.match(text)
- self.assertIsNotNone(match)
-
-
-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):
- """
- The OEmbedExtension should ignore these tags allowing markdown's image
- processor to find and handle them.
- """
-
- def test_relative(self):
- text = ''
- expected = '