feat: doing lots of stuff

This commit is contained in:
Stevan Freeborn
2026-07-08 08:04:22 -05:00
commit 090aacdbb8
45 changed files with 1781 additions and 0 deletions
+43
View File
@@ -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 ![rick roll](https://i.imgur.com/aKaOqIh.gif) and ![obi wan](https://i.imgur.com/fJRm4Vk.jpeg)")
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)