Пример #1
0
 def test_message_file_from_string_file(
     self,
     sending_message: SendingMessage,
 ) -> None:
     original_file = sending_message.file
     sending_message.add_file(
         StringIO(original_file.file.read().decode()),
         filename=original_file.file_name,
     )
     assert sending_message.file == original_file
Пример #2
0
 def test_message_file_from_bytes_file(
     self,
     sending_message: SendingMessage,
 ) -> None:
     original_file = sending_message.file
     sending_message.add_file(
         BytesIO(original_file.file.read()),
         filename=original_file.file_name,
     )
     assert sending_message.file == original_file
Пример #3
0
 def test_message_file_from_file(
         self, sending_message: SendingMessage) -> None:
     original_file = sending_message.file
     sending_message.add_file(File.from_file(original_file.file))
     assert sending_message.file == original_file