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(), ), )
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(), ), )
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
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
def test_building_forward_via_message(self, message): builder = MessageBuilder() builder.forward(message=message)