add some higher tests

add first tests
This commit is contained in:
onyx-and-iris
2022-02-25 15:17:05 +00:00
parent 838e3c4999
commit 6e40ceb346
5 changed files with 65 additions and 13 deletions

17
tests/__init__.py Normal file
View File

@@ -0,0 +1,17 @@
import vban_cmd
from vban_cmd import kinds
import socket
from threading import Thread
_kind = 'banana'
vbanrs = {kind.id: vban_cmd.connect(_kind, ip='ws.local') for kind in kinds.all}
tests = vbanrs[_kind]
def setup_package():
tests._rt_packet_socket.bind((socket.gethostbyname(socket.gethostname()), tests._port))
tests.worker = Thread(target=tests._send_register_rt, daemon=True)
tests.worker.start()
def teardown_package():
pass

20
tests/test_higher.py Normal file
View File

@@ -0,0 +1,20 @@
from nose.tools import assert_equal, nottest
from parameterized import parameterized, parameterized_class
import unittest
from tests import tests
#@nottest
@parameterized_class([
{ "val": False }, { "val": True }
])
class TestSetAndGetBoolHigher(unittest.TestCase):
""" strip tests, physical and virtual """
@parameterized.expand([
(0, 'mute'), (2, 'mono'), (3, 'A1'), (3, 'B3')
])
def test_it_sets_and_gets_strip_bool_params(self, index, param):
setattr(tests.strip[index], param, self.val)
retval = getattr(tests.strip[index], param)
self.assertTrue(isinstance(retval, bool))
assert_equal(retval, self.val)