boxnotes2html

Convert Box's proprietary Box Notes to HTML, Markdown, or plain text
git clone git://git.alexwennerberg.com/boxnotes2html
Log | Files | Refs | README | LICENSE

test_boxhtml.py (912B) - raw


      1 from boxnotes2html import html
      2 
      3 
      4 def test_html_tag_conversion():
      5     bold = ["bold", "true"]
      6     assert html.convert_simple_element_to_html_tag(bold) == html.HTMLTag("b", {})
      7 
      8 
      9 def test_url_conversion():
     10     url = "link-MTU0MTI5MDcxMzcxMC1odHRwczovL2Vtb2ppcGVkaWEub3JnL3NtaWxpbmctZmFjZS13aXRoLWhlYXJ0LXNoYXBlZC1leWVzLw=="
     11     assert (
     12         html._decode_link(url)
     13         == "https://emojipedia.org/smiling-face-with-heart-shaped-eyes/"
     14     )
     15 
     16 
     17 def test_image_conversion():
     18     image = "image-305f112d24f84324805f3eaa9e64ecbe-JTdCJTIyYm94U2hhcmVkTGluayUyMiUzQSUyMmh0dHBzJTNBJTJGJTJGYXBwLmJveC5jb20lMkZzJTJGMnU0MXE5aTdrb25mcjBlYWZzOW45NHoyY2hqbXB1ZGglMjIlMkMlMjJib3hGaWxlSWQlMjIlM0ElMjIzNDM3ODk3NTE2MzUlMjIlMkMlMjJmaWxlTmFtZSUyMiUzQSUyMm9wZW5zb3VyY2VwYXJyb3QuZ2lmJTIyJTdE"
     19     assert (
     20         html._decode_image(image)["boxSharedLink"]
     21         == "https://app.box.com/s/2u41q9i7konfr0eafs9n94z2chjmpudh"
     22     )