diff tests/unit/conftest.py @ 4232:0fbe5c605eb6

tests (unit/webrtc,XEP-0176, XEP-0234): Fix tests and add webrtc file transfer tests: fix 441
author Goffi <goffi@goffi.org>
date Sat, 06 Apr 2024 12:59:50 +0200
parents 7c5654c54fed
children
line wrap: on
line diff
--- a/tests/unit/conftest.py	Sat Apr 06 12:57:23 2024 +0200
+++ b/tests/unit/conftest.py	Sat Apr 06 12:59:50 2024 +0200
@@ -39,7 +39,7 @@
     return AsyncMock()
 
 
-class MockSAT(LiberviaBackend):
+class MockLiberviaBackend(LiberviaBackend):
 
     def __init__(self, bridge, storage):
         self._cb_map = {}
@@ -76,6 +76,11 @@
     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 @@
 
 @fixture(scope="session")
 def host(bridge, storage):
-    host = MockSAT(bridge=bridge, storage=storage)
+    host = MockLiberviaBackend(bridge=bridge, storage=storage)
     return host