MCPcopy Index your code
hub / github.com/O365/python-o365 / test_attachments

Method test_attachments

tests/test_message.py:16–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

14 assert msg_1 == msg_2
15
16 def test_attachments(self):
17 msg = message()
18 assert repr(msg.attachments) == "Number of Attachments: 0"
19 msg.attachments.add([(io.BytesIO(b"content"), "filename.txt")])
20 assert len(msg.attachments) == 1
21 assert repr(msg.attachments) == "Number of Attachments: 1"
22 assert "filename.txt" in msg.attachments
23 msg.attachments.clear()
24 assert len(msg.attachments) == 0
25
26 msg.attachments.add([(io.BytesIO(b"content"), "filename.txt")])
27 assert [at.name for at in msg.attachments] == ["filename.txt"]
28 assert msg.attachments[0].name == "filename.txt"
29 msg.attachments.remove(["filename.txt"])
30
31 def test_properties(self):
32 msg = message(

Callers

nothing calls this directly

Calls 4

messageFunction · 0.85
addMethod · 0.45
clearMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected