]> www.average.org Git - loctrkd.git/blobdiff - test/common.py
abstract protocol selection in `common`
[loctrkd.git] / test / common.py
index df430233adbff50eddca0ac7c7bb217292df3e0f..58954a2b217acbd0fa5a930476cee1882dea8ff1 100644 (file)
@@ -23,6 +23,8 @@ from time import sleep
 from typing import Optional
 from unittest import TestCase
 
+from loctrkd.common import init_protocols
+
 NUMPORTS = 3
 
 
@@ -39,11 +41,13 @@ class TestWithServers(TestCase):
                 freeports.append(sk.getsockname()[1])
         _, self.tmpfilebase = mkstemp()
         self.conf = ConfigParser()
+        self.conf["common"] = {
+            "protocols": "zx303proto",
+        }
         self.conf["collector"] = {
             "port": str(freeports[0]),
             "publishurl": "ipc://" + self.tmpfilebase + ".pub",
             "listenurl": "ipc://" + self.tmpfilebase + ".pul",
-            "protocols": "zx303proto",
         }
         self.conf["storage"] = {
             "dbfn": self.tmpfilebase + ".storage.sqlite",
@@ -52,12 +56,14 @@ class TestWithServers(TestCase):
             "dbfn": self.tmpfilebase + ".opencellid.sqlite",
             "downloadurl": f"http://localhost:{freeports[2]}/test/262.csv.gz",
         }
-        self.conf["lookaside"] = {
-            "backend": "opencellid",
+        self.conf["rectifier"] = {
+            "lookaside": "opencellid",
+            "publishurl": "ipc://" + self.tmpfilebase + ".rect.pub",
         }
         self.conf["wsgateway"] = {
             "port": str(freeports[1]),
         }
+        init_protocols(self.conf)
         self.children = []
         for srvname in args:
             if srvname == "collector":
@@ -99,6 +105,7 @@ class TestWithServers(TestCase):
         for sfx in (
             "",
             ".pub",
+            ".rect.pub",
             ".pul",
             ".storage.sqlite",
             ".opencellid.sqlite",