2022-08-07 23:55:51 +01:00
|
|
|
import sys
|
2022-04-05 20:05:55 +01:00
|
|
|
import threading
|
2022-05-01 03:46:44 +01:00
|
|
|
from dataclasses import dataclass
|
2022-08-07 23:55:51 +01:00
|
|
|
|
|
|
|
import xair_api
|
|
|
|
from xair_api import kinds
|
2022-04-05 20:05:55 +01:00
|
|
|
|
2022-05-01 03:46:44 +01:00
|
|
|
kind_id = "MR18"
|
|
|
|
ip = "mixer.local"
|
2022-04-05 20:05:55 +01:00
|
|
|
|
2022-08-07 23:55:51 +01:00
|
|
|
tests = xair_api.connect(kind_id, ip=ip)
|
2022-04-05 20:05:55 +01:00
|
|
|
|
2022-05-01 03:46:44 +01:00
|
|
|
kind = kinds.get(kind_id)
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Data:
|
|
|
|
"""bounds data to map tests to a kind"""
|
|
|
|
|
|
|
|
name: str = kind.id_
|
|
|
|
dca: int = kind.num_dca - 1
|
|
|
|
strip: int = kind.num_strip - 1
|
|
|
|
bus: int = kind.num_bus - 1
|
|
|
|
fx: int = kind.num_fx - 1
|
|
|
|
rtn: int = kind.num_rtn - 1
|
|
|
|
|
|
|
|
|
|
|
|
data = Data()
|
|
|
|
|
|
|
|
|
|
|
|
def setup_module():
|
|
|
|
print(f"\nRunning tests for kind [{data.name}]\n", file=sys.stdout)
|
|
|
|
tests.worker = threading.Thread(target=tests.run_server)
|
2022-04-05 20:05:55 +01:00
|
|
|
tests.worker.daemon = True
|
|
|
|
tests.worker.start()
|
|
|
|
tests.validate_connection()
|
|
|
|
|
2022-05-01 03:46:44 +01:00
|
|
|
|
|
|
|
def teardown_module():
|
2022-04-05 20:05:55 +01:00
|
|
|
tests.server.shutdown()
|