mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 05:16:39 +03:00
renamings and parallel sending
This commit is contained in:
@@ -396,15 +396,18 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data):
|
|||||||
ac2.create_chat(ac1)
|
ac2.create_chat(ac1)
|
||||||
return ac1.create_chat(ac2)
|
return ac1.create_chat(ac2)
|
||||||
|
|
||||||
def accept_each_other(self, accounts, sending=False):
|
def introduce_each_other(self, accounts, sending=True):
|
||||||
|
to_wait = []
|
||||||
for i, acc in enumerate(accounts):
|
for i, acc in enumerate(accounts):
|
||||||
for acc2 in accounts[i + 1:]:
|
for acc2 in accounts[i + 1:]:
|
||||||
chat = self.get_accepted_chat(acc, acc2)
|
chat = self.get_accepted_chat(acc, acc2)
|
||||||
if sending:
|
if sending:
|
||||||
chat.send_text("hi")
|
chat.send_text("hi")
|
||||||
acc2._evtracker.wait_next_incoming_message()
|
to_wait.append(acc2)
|
||||||
acc2.create_chat(acc).send_text("hi back")
|
acc2.create_chat(acc).send_text("hi back")
|
||||||
acc._evtracker.wait_next_incoming_message()
|
to_wait.append(acc)
|
||||||
|
for acc in to_wait:
|
||||||
|
acc._evtracker.wait_next_incoming_message()
|
||||||
|
|
||||||
am = AccountMaker()
|
am = AccountMaker()
|
||||||
request.addfinalizer(am.finalize)
|
request.addfinalizer(am.finalize)
|
||||||
|
|||||||
@@ -1508,7 +1508,7 @@ class TestOnlineAccount:
|
|||||||
lp.sec("creating and configuring three accounts")
|
lp.sec("creating and configuring three accounts")
|
||||||
ac1, ac2, ac3 = acfactory.get_many_online_accounts(3)
|
ac1, ac2, ac3 = acfactory.get_many_online_accounts(3)
|
||||||
|
|
||||||
acfactory.accept_each_other([ac1, ac2, ac3], sending=True)
|
acfactory.introduce_each_other([ac1, ac2, ac3])
|
||||||
|
|
||||||
lp.sec("ac3 reinstalls DC and generates a new key")
|
lp.sec("ac3 reinstalls DC and generates a new key")
|
||||||
ac3.stop_io()
|
ac3.stop_io()
|
||||||
@@ -1568,7 +1568,7 @@ class TestOnlineAccount:
|
|||||||
class TestGroupStressTests:
|
class TestGroupStressTests:
|
||||||
def test_group_many_members_add_leave_remove(self, acfactory, lp):
|
def test_group_many_members_add_leave_remove(self, acfactory, lp):
|
||||||
accounts = acfactory.get_many_online_accounts(5)
|
accounts = acfactory.get_many_online_accounts(5)
|
||||||
acfactory.accept_each_other(accounts, sending=True)
|
acfactory.introduce_each_other(accounts)
|
||||||
ac1, ac5 = accounts.pop(), accounts.pop()
|
ac1, ac5 = accounts.pop(), accounts.pop()
|
||||||
|
|
||||||
lp.sec("ac1: creating group chat with 3 other members")
|
lp.sec("ac1: creating group chat with 3 other members")
|
||||||
@@ -1641,7 +1641,7 @@ class TestGroupStressTests:
|
|||||||
"""
|
"""
|
||||||
lp.sec("setting up accounts, accepted with each other")
|
lp.sec("setting up accounts, accepted with each other")
|
||||||
accounts = acfactory.get_many_online_accounts(3)
|
accounts = acfactory.get_many_online_accounts(3)
|
||||||
acfactory.accept_each_other(accounts, sending=True)
|
acfactory.introduce_each_other(accounts)
|
||||||
ac1, ac2, ac3 = accounts
|
ac1, ac2, ac3 = accounts
|
||||||
|
|
||||||
lp.sec("ac1: creating group chat with 2 other members")
|
lp.sec("ac1: creating group chat with 2 other members")
|
||||||
|
|||||||
Reference in New Issue
Block a user