tests (unit/webrtc,XEP-0176, XEP-0234): Fix tests and add webrtc file transfer tests:

fix 441
This commit is contained in:
Goffi 2024-04-06 12:59:50 +02:00
commit 27b66b3fb2

View file

@ -39,7 +39,7 @@ def storage():
return AsyncMock()
class MockSAT(LiberviaBackend):
class MockLiberviaBackend(LiberviaBackend):
def __init__(self, bridge, storage):
self._cb_map = {}
@ -76,6 +76,11 @@ class MockSAT(LiberviaBackend):
def clear_test_config(self):
self._test_config.clear()
def register_namespace(self, short_name, namespace):
# Plugin classes may be instantiated several times in tests, so we do nothing in
# this method to avoid ConflictError.
pass
@contextmanager
def use_option_and_reload(self, section, name, value):
self.set_test_config(section, name, value)
@ -104,7 +109,7 @@ class MockSAT(LiberviaBackend):
@fixture(scope="session")
def host(bridge, storage):
host = MockSAT(bridge=bridge, storage=storage)
host = MockLiberviaBackend(bridge=bridge, storage=storage)
return host