X-Git-Url: https://git.madduck.net/etc/neomutt.git/blobdiff_plain/5f583dd6f81b280645e008beca34c64aa63c6a0f..9bb6eec308bbe3c7f0d9348324cb1dade2437946:/.config/neomutt/buildmimetree.py diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index 40bd856..06f62c5 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -246,7 +246,7 @@ def collect_inline_images( filewriter_fn(path, data.read(), "w+b") relparts.append( - Part(*mimetype.split("/"), path, cid=info.cid, desc=info.desc) + Part(*mimetype.split("/"), path, cid=info.cid, desc=f"Image: {info.desc}") ) return relparts @@ -495,7 +495,7 @@ def do_massage( # appropriate grouping: if item.subtype == "alternative": cmds.push("") - elif item.subtype == "relative": + elif item.subtype in ("relative", "related"): cmds.push("") elif item.subtype == "multilingual": cmds.push("") @@ -920,23 +920,21 @@ try: assert tree.children[1].path == written[0] assert written[1] == request.urlopen(test_png).read() - def test_inline_image_collection(self, test_png, const1, const2, fake_filewriter): - test_images = { - test_png: InlineImageInfo( - cid=const1, desc=const2 - ) - } + def test_inline_image_collection( + self, test_png, const1, const2, fake_filewriter + ): + test_images = {test_png: InlineImageInfo(cid=const1, desc=const2)} relparts = collect_inline_images( test_images, filewriter_fn=fake_filewriter ) written = fake_filewriter.pop() - assert b'PNG' in written[1] + assert b"PNG" in written[1] assert relparts[0].subtype == "png" assert relparts[0].path == written[0] assert relparts[0].cid == const1 - assert relparts[0].desc == const2 + assert relparts[0].desc.endswith(const2) except ImportError: pass