tests (unit): fix tests + black reformatting.

This commit is contained in:
Goffi 2024-07-14 17:42:53 +02:00
commit 067d8f32bf

View file

@ -35,7 +35,6 @@ from libervia.backend.tools.common import data_format
TEST_ROOM_JID = jid.JID("room@example.com/user")
@fixture
def xep_0272(host) -> XEP_0272:
"""Fixture for initializing XEP-0272 plugin."""
@ -64,11 +63,8 @@ class TestXEP0272:
muji_elt = presence_elt.addElement((NS_MUJI, "muji"))
muji_elt.addElement("preparing")
muji_data = {
"preparing_jids": set()
}
with patch.object(
xep_0272._muc, "get_room_user_jid", return_value=TEST_ROOM_JID) :
muji_data = {"preparing_jids": set()}
with patch.object(xep_0272._muc, "get_room_user_jid", return_value=TEST_ROOM_JID):
with patch.object(xep_0272, "get_muji_data", return_value=muji_data):
with patch.object(
xep_0272, "try_to_finish_preparation"
@ -83,11 +79,7 @@ class TestXEP0272:
presence_elt["from"] = "room@example.com/user"
presence_elt.addElement((NS_MUJI, "muji"))
muji_data = {
"done_preparing": True,
"preparing_jids": set(),
"to_call": set()
}
muji_data = {"done_preparing": True, "preparing_jids": set(), "to_call": set()}
with patch.object(xep_0272, "get_muji_data", return_value=muji_data):
with patch.object(
xep_0272, "try_to_finish_preparation"