From: martin f. krafft Date: Wed, 23 Aug 2023 04:50:40 +0000 (+1200) Subject: buildmimetree.py: test-cover inline image collection X-Git-Url: https://git.madduck.net/etc/neomutt.git/commitdiff_plain/4c1047e8f32300cca35b3adcbedf9f557d657fe1?hp=364d99e812bcab71aee336d73c458c2f9f0d7fa2 buildmimetree.py: test-cover inline image collection --- diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index bd446bf..bd891a2 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -889,5 +889,23 @@ 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 + ) + } + relparts = collect_inline_images( + test_images, filewriter_fn=fake_filewriter + ) + + written = fake_filewriter.pop() + 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 + except ImportError: pass