tests (xep_0272): assert the group setup call in the preparation test
This commit is contained in:
parent
7325353d18
commit
63b3f4dfe2
1 changed files with 8 additions and 2 deletions
|
|
@ -102,14 +102,20 @@ class TestXEP0272:
|
|||
mock_try_to_finish_preparation.assert_not_called()
|
||||
|
||||
def test_try_to_finish_preparation(self, host, client):
|
||||
"""try_to_finish_preparation sets done_preparing to True."""
|
||||
"""try_to_finish_preparation sets done_preparing to True and emits the signal."""
|
||||
xep_0272 = XEP_0272(host)
|
||||
room = MagicMock()
|
||||
muji_data = {"preparing_jids": set(), "to_call": set()}
|
||||
|
||||
with patch.object(xep_0272, "get_muji_data", return_value=muji_data):
|
||||
# signals are synchronous (see _Bridge.send_signal): use a plain mock, not the
|
||||
# async one of the bridge fixture
|
||||
with (
|
||||
patch.object(xep_0272, "get_muji_data", return_value=muji_data),
|
||||
patch.object(host.bridge, "call_group_setup") as mock_call_group_setup,
|
||||
):
|
||||
xep_0272.try_to_finish_preparation(client, room, muji_data)
|
||||
assert muji_data["done_preparing"] is True
|
||||
mock_call_group_setup.assert_called_once()
|
||||
|
||||
@ed
|
||||
async def test_call_group_data_set(self, host, client):
|
||||
|
|
|
|||
Loading…
Reference in a new issue