(acfactory, lp)
| 119 | |
| 120 | |
| 121 | def test_html_message(acfactory, lp): |
| 122 | ac1, ac2 = acfactory.get_online_accounts(2) |
| 123 | chat = acfactory.get_accepted_chat(ac1, ac2) |
| 124 | html_text = "<p>hello HTML world</p>" |
| 125 | |
| 126 | lp.sec("ac1: prepare and send text message to ac2") |
| 127 | msg1 = chat.send_text("message0") |
| 128 | assert not msg1.has_html() |
| 129 | assert not msg1.html |
| 130 | |
| 131 | lp.sec("wait for ac2 to receive message") |
| 132 | msg2 = ac2._evtracker.wait_next_incoming_message() |
| 133 | assert msg2.text == "message0" |
| 134 | assert not msg2.has_html() |
| 135 | assert not msg2.html |
| 136 | |
| 137 | lp.sec("ac1: prepare and send HTML+text message to ac2") |
| 138 | msg1 = Message.new_empty(ac1, "text") |
| 139 | msg1.set_text("message1") |
| 140 | msg1.set_html(html_text) |
| 141 | msg1 = chat.send_msg(msg1) |
| 142 | assert msg1.has_html() |
| 143 | assert html_text in msg1.html |
| 144 | |
| 145 | lp.sec("wait for ac2 to receive message") |
| 146 | msg2 = ac2._evtracker.wait_next_incoming_message() |
| 147 | assert msg2.text == "message1" |
| 148 | assert msg2.has_html() |
| 149 | assert html_text in msg2.html |
| 150 | |
| 151 | lp.sec("ac1: prepare and send HTML-only message to ac2") |
| 152 | msg1 = Message.new_empty(ac1, "text") |
| 153 | msg1.set_html(html_text) |
| 154 | msg1 = chat.send_msg(msg1) |
| 155 | |
| 156 | lp.sec("wait for ac2 to receive message") |
| 157 | msg2 = ac2._evtracker.wait_next_incoming_message() |
| 158 | assert "<p>" not in msg2.text |
| 159 | assert "hello HTML world" in msg2.text |
| 160 | assert msg2.has_html() |
| 161 | assert html_text in msg2.html |
| 162 | |
| 163 | |
| 164 | def test_webxdc_message(acfactory, data, lp): |
nothing calls this directly
no test coverage detected