Test that bot messages can be identified as such
(acfactory, lp)
| 628 | |
| 629 | |
| 630 | def test_bot(acfactory, lp): |
| 631 | """Test that bot messages can be identified as such""" |
| 632 | ac1, ac2 = acfactory.get_online_accounts(2) |
| 633 | ac1.set_config("bot", "0") |
| 634 | ac2.set_config("bot", "1") |
| 635 | |
| 636 | lp.sec("ac1: create chat with ac2") |
| 637 | chat = acfactory.get_accepted_chat(ac1, ac2) |
| 638 | |
| 639 | lp.sec("sending a message from ac1 to ac2") |
| 640 | text1 = "hello" |
| 641 | chat.send_text(text1) |
| 642 | |
| 643 | lp.sec("wait for ac2 to receive a message") |
| 644 | msg_in = ac2._evtracker.wait_next_incoming_message() |
| 645 | assert msg_in.text == text1 |
| 646 | assert not msg_in.is_bot() |
| 647 | |
| 648 | lp.sec("sending a message from ac2 to ac1") |
| 649 | text2 = "reply" |
| 650 | msg_in.chat.send_text(text2) |
| 651 | |
| 652 | lp.sec("wait for ac1 to receive a message") |
| 653 | msg_in = ac1._evtracker.wait_next_incoming_message() |
| 654 | assert msg_in.text == text2 |
| 655 | assert msg_in.is_bot() |
| 656 | |
| 657 | |
| 658 | def test_quote_attachment(tmp_path, acfactory, lp): |
nothing calls this directly
no test coverage detected