Test that replies with an attachment and a quote are received correctly.
(tmp_path, acfactory, lp)
| 656 | |
| 657 | |
| 658 | def test_quote_attachment(tmp_path, acfactory, lp): |
| 659 | """Test that replies with an attachment and a quote are received correctly.""" |
| 660 | ac1, ac2 = acfactory.get_online_accounts(2) |
| 661 | |
| 662 | lp.sec("ac1 creates chat with ac2") |
| 663 | chat1 = ac1.create_chat(ac2) |
| 664 | |
| 665 | lp.sec("ac1 sends text message to ac2") |
| 666 | chat1.send_text("hi") |
| 667 | |
| 668 | lp.sec("ac2 receives contact request from ac1") |
| 669 | received_message = ac2._evtracker.wait_next_incoming_message() |
| 670 | assert received_message.text == "hi" |
| 671 | |
| 672 | basename = "attachment.txt" |
| 673 | p = tmp_path / basename |
| 674 | p.write_text("data to send") |
| 675 | |
| 676 | lp.sec("ac2 sends a reply to ac1") |
| 677 | chat2 = received_message.create_chat() |
| 678 | reply = Message.new_empty(ac2, "file") |
| 679 | reply.set_text("message reply") |
| 680 | reply.set_file(str(p)) |
| 681 | reply.quote = received_message |
| 682 | chat2.send_msg(reply) |
| 683 | |
| 684 | lp.sec("ac1 receives a reply from ac2") |
| 685 | received_reply = ac1._evtracker.wait_next_incoming_message() |
| 686 | assert received_reply.text == "message reply" |
| 687 | assert received_reply.quoted_text == received_message.text |
| 688 | assert open(received_reply.filename).read() == "data to send" |
| 689 | |
| 690 | |
| 691 | def test_send_mark_seen_clean_incoming_events(acfactory, lp): |
nothing calls this directly
no test coverage detected