Exemple #1
0
 def test_building_forward_via_models(self):
     builder = MessageBuilder()
     builder.forward(
         forward=Forward(
             group_chat_id=uuid.uuid4(),
             sender_huid=uuid.uuid4(),
             forward_type=ChatTypes.group_chat,  # ignore: type
             source_inserted_at=datetime.now(),
             source_sync_id=uuid.uuid4(),
         ), )
Exemple #2
0
 def test_building_forward_arguments_error(self, message):
     builder = MessageBuilder()
     with pytest.raises(ValueError):
         builder.forward(
             message=message,
             forward=Forward(
                 group_chat_id=uuid.uuid4(),
                 sender_huid=uuid.uuid4(),
                 forward_type=ChatTypes.botx,  # ignore: type
                 source_inserted_at=datetime.now(),
                 source_sync_id=uuid.uuid4(),
             ),
         )
Exemple #3
0
 def test_forward_in_message(self, message) -> None:
     builder = MessageBuilder()
     builder.forward(message=message)
     assert builder.message.entities.forward.source_sync_id == message.sync_id
Exemple #4
0
 def test_is_forward_message(self, message, bot) -> None:
     builder = MessageBuilder()
     builder.forward(message=message)
     new_message = Message.from_dict(message=builder.message.dict(),
                                     bot=bot)
     assert new_message.is_forward
Exemple #5
0
 def test_building_forward_via_message(self, message):
     builder = MessageBuilder()
     builder.forward(message=message)