2022-04-26 07:16:21 +01:00
|
|
|
import random
|
2022-04-28 11:34:48 +01:00
|
|
|
import sys
|
2022-06-16 16:10:06 +01:00
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
|
|
import vban_cmd
|
|
|
|
from vban_cmd.kinds import KindId, kinds_all
|
|
|
|
from vban_cmd.kinds import request_kind_map as kindmap
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
# let's keep things random
|
2022-06-16 16:10:06 +01:00
|
|
|
kind_id = random.choice(tuple(kind_id.name.lower() for kind_id in KindId))
|
2022-02-25 15:17:05 +00:00
|
|
|
|
2022-02-28 18:14:31 +00:00
|
|
|
opts = {
|
2022-06-16 16:10:06 +01:00
|
|
|
"ip": "ws.local",
|
|
|
|
"streamname": "workstation",
|
2022-04-08 21:16:37 +01:00
|
|
|
"port": 6990,
|
|
|
|
"bps": 0,
|
|
|
|
"sync": True,
|
2022-02-28 18:14:31 +00:00
|
|
|
}
|
2022-02-25 15:17:05 +00:00
|
|
|
|
2022-06-16 16:10:06 +01:00
|
|
|
vbans = {kind.name: vban_cmd.api(kind.name, **opts) for kind in kinds_all}
|
2022-04-26 07:16:21 +01:00
|
|
|
tests = vbans[kind_id]
|
2022-06-16 16:10:06 +01:00
|
|
|
kind = kindmap(kind_id)
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Data:
|
|
|
|
"""bounds data to map tests to a kind"""
|
|
|
|
|
2022-06-16 16:10:06 +01:00
|
|
|
name: str = kind.name
|
2022-04-26 07:16:21 +01:00
|
|
|
phys_in: int = kind.ins[0] - 1
|
|
|
|
virt_in: int = kind.ins[0] + kind.ins[1] - 1
|
|
|
|
phys_out: int = kind.outs[0] - 1
|
|
|
|
virt_out: int = kind.outs[0] + kind.outs[1] - 1
|
|
|
|
vban_in: int = kind.vban[0] - 1
|
|
|
|
vban_out: int = kind.vban[1] - 1
|
|
|
|
button_lower: int = 0
|
|
|
|
button_upper: int = 79
|
|
|
|
|
|
|
|
|
|
|
|
data = Data()
|
2022-02-25 15:17:05 +00:00
|
|
|
|
2022-04-08 21:16:37 +01:00
|
|
|
|
2022-04-26 07:16:21 +01:00
|
|
|
def setup_module():
|
2022-04-28 11:34:48 +01:00
|
|
|
print(f"\nRunning tests for kind [{data.name}]\n", file=sys.stdout)
|
2022-03-20 12:46:05 +00:00
|
|
|
tests.login()
|
2022-02-25 17:02:27 +00:00
|
|
|
|
2022-04-08 21:16:37 +01:00
|
|
|
|
2022-04-26 07:16:21 +01:00
|
|
|
def teardown_module():
|
2022-03-20 12:46:05 +00:00
|
|
|
tests.logout()
|