MCPcopy Create free account
hub / github.com/chatmail/core / test_message_image

Method test_message_image

python/tests/test_3_offline.py:361–373  ·  view source on GitHub ↗
(self, chat1, data, lp)

Source from the content-addressed store, hash-verified

359 assert not msg.is_out_mdn_received()
360
361 def test_message_image(self, chat1, data, lp):
362 with pytest.raises(ValueError):
363 chat1.send_image(path="notexists")
364 fn = data.get_path("d.png")
365 lp.sec("sending image")
366 chat1.account._evtracker.consume_events()
367 msg = chat1.send_image(fn)
368 chat1.account._evtracker.get_matching("DC_EVENT_NEW_BLOB_FILE")
369 assert msg.is_image()
370 assert msg
371 assert msg.id > 0
372 assert os.path.exists(msg.filename)
373 assert msg.filemime == "image/png"
374
375 @pytest.mark.parametrize(
376 ("fn", "typein", "typeout"),

Callers

nothing calls this directly

Calls 7

send_imageMethod · 0.80
secMethod · 0.80
consume_eventsMethod · 0.80
is_imageMethod · 0.80
get_pathMethod · 0.45
get_matchingMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected