2022-02-25 17:02:27 +00:00
|
|
|
from nose.tools import assert_equal, nottest
|
|
|
|
from parameterized import parameterized, parameterized_class
|
|
|
|
|
|
|
|
import unittest
|
2022-04-08 21:16:37 +01:00
|
|
|
from vbancmd.channel import Modes
|
2022-02-25 17:02:27 +00:00
|
|
|
from tests import tests
|
|
|
|
|
2022-04-08 21:16:37 +01:00
|
|
|
# @nottest
|
|
|
|
@parameterized_class(
|
|
|
|
[
|
|
|
|
{"val": 0},
|
|
|
|
{"val": 1},
|
|
|
|
]
|
|
|
|
)
|
2022-02-25 17:02:27 +00:00
|
|
|
class TestSetAndGetParamsLower(unittest.TestCase):
|
2022-04-08 21:16:37 +01:00
|
|
|
def setUp(self) -> None:
|
|
|
|
tests._modes = Modes()
|
|
|
|
|
2022-02-25 17:02:27 +00:00
|
|
|
""" get_rt, set_rt test """
|
2022-04-08 21:16:37 +01:00
|
|
|
|
|
|
|
@parameterized.expand(
|
|
|
|
[
|
|
|
|
(0, "mute"),
|
|
|
|
(4, "mute"),
|
|
|
|
]
|
|
|
|
)
|
2022-02-25 17:02:27 +00:00
|
|
|
def test_it_sets_and_gets_strip_bool_params(self, index, param):
|
2022-04-08 21:16:37 +01:00
|
|
|
tests.set_rt(f"Strip[{index}]", param, self.val)
|
2022-02-26 23:57:19 +00:00
|
|
|
retval = tests._get_rt()
|
2022-04-08 21:16:37 +01:00
|
|
|
retval = (
|
|
|
|
not int.from_bytes(retval.stripstate[index], "little") & tests._modes._mute
|
|
|
|
== 0
|
|
|
|
)
|
2022-02-25 17:02:27 +00:00
|
|
|
assert_equal(retval, self.val)
|
|
|
|
|
2022-04-08 21:16:37 +01:00
|
|
|
@parameterized.expand(
|
|
|
|
[
|
|
|
|
(0, "mono"),
|
|
|
|
(5, "mono"),
|
|
|
|
]
|
|
|
|
)
|
2022-02-25 17:02:27 +00:00
|
|
|
def test_it_sets_and_gets_strip_bool_params(self, index, param):
|
2022-04-08 21:16:37 +01:00
|
|
|
tests.set_rt(f"Strip[{index}]", param, self.val)
|
2022-02-26 23:57:19 +00:00
|
|
|
retval = tests._get_rt()
|
2022-04-08 21:16:37 +01:00
|
|
|
retval = (
|
|
|
|
not int.from_bytes(retval.stripstate[index], "little") & tests._modes._mono
|
|
|
|
== 0
|
|
|
|
)
|
2022-02-25 17:02:27 +00:00
|
|
|
assert_equal(retval, self.val)
|