mirror of
https://github.com/chatmail/relay.git
synced 2026-05-18 20:08:21 +00:00
add ping-pong bench and formatting
This commit is contained in:
@@ -19,6 +19,7 @@ def test_tls_smtp(benchmark, smtp):
|
||||
|
||||
benchmark(smtp_connect, 10)
|
||||
|
||||
|
||||
def test_login_smtp(benchmark, smtp, gencreds):
|
||||
def smtp_connect_and_login():
|
||||
smtp.connect()
|
||||
@@ -39,3 +40,17 @@ def test_send_and_receive_10(benchmark, cmfactory, lp):
|
||||
ac2.wait_next_incoming_message()
|
||||
|
||||
benchmark(send_10_receive_all, 1)
|
||||
|
||||
|
||||
def test_ping_pong(benchmark, cmfactory, lp):
|
||||
"""send many messages between two accounts"""
|
||||
ac1, ac2 = cmfactory.get_online_accounts(2)
|
||||
chat = cmfactory.get_accepted_chat(ac1, ac2)
|
||||
|
||||
def ping_pong():
|
||||
chat.send_text("ping")
|
||||
msg = ac2.wait_next_incoming_message()
|
||||
msg.chat.send_text("pong")
|
||||
ac1.wait_next_incoming_message()
|
||||
|
||||
benchmark(ping_pong, 5)
|
||||
|
||||
Reference in New Issue
Block a user