feat: doing lots of stuff
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import unittest
|
||||
|
||||
from extract import extract_markdown_images, extract_markdown_links
|
||||
|
||||
|
||||
class TextExtract(unittest.TestCase):
|
||||
def test_extract_markdown_images_when_given_no_images_it_should_return_empty_list(
|
||||
self,
|
||||
):
|
||||
result = extract_markdown_images("")
|
||||
|
||||
self.assertListEqual(result, [])
|
||||
|
||||
def test_extract_markdown_images_when_given_images_it_should_return_list(
|
||||
self,
|
||||
):
|
||||
expected = [
|
||||
("rick roll", "https://i.imgur.com/aKaOqIh.gif"),
|
||||
("obi wan", "https://i.imgur.com/fJRm4Vk.jpeg")
|
||||
]
|
||||
|
||||
result = extract_markdown_images("This is text with a  and ")
|
||||
|
||||
self.assertListEqual(result, expected)
|
||||
|
||||
def test_extract_markdown_links_when_given_no_links_it_should_return_empty_list(
|
||||
self,
|
||||
):
|
||||
result = extract_markdown_links("")
|
||||
|
||||
self.assertListEqual(result, [])
|
||||
|
||||
def test_extract_markdown_links_when_given_links_it_should_return_list(
|
||||
self,
|
||||
):
|
||||
expected = [
|
||||
("to boot dev", "https://www.boot.dev"),
|
||||
("to youtube", "https://www.youtube.com/@bootdotdev")
|
||||
]
|
||||
|
||||
result = extract_markdown_links("This is text with a link [to boot dev](https://www.boot.dev) and [to youtube](https://www.youtube.com/@bootdotdev)")
|
||||
|
||||
self.assertListEqual(result, expected)
|
||||
Reference in New Issue
Block a user