diff options
author | Devaev Maxim <[email protected]> | 2020-10-02 04:07:16 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-10-02 04:07:16 +0300 |
commit | 2b684caaeb3402251de9d982666d8e025c5325de (patch) | |
tree | 1e6f9940648982c3e5a8267398d7fb2e5d6394a1 /testenv/tests | |
parent | bd3e2ba606039484499420b9a0539ce191f83c08 (diff) |
added tests
Diffstat (limited to 'testenv/tests')
-rw-r--r-- | testenv/tests/validators/test_hw.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_hw.py b/testenv/tests/validators/test_hw.py index 2956375c..bcc3531f 100644 --- a/testenv/tests/validators/test_hw.py +++ b/testenv/tests/validators/test_hw.py @@ -30,6 +30,7 @@ from kvmd.validators.hw import valid_gpio_pin from kvmd.validators.hw import valid_gpio_pin_optional from kvmd.validators.hw import valid_otg_gadget from kvmd.validators.hw import valid_otg_id +from kvmd.validators.hw import valid_otg_ethernet # ===== @@ -117,3 +118,15 @@ def test_ok__valid_otg_id(arg: Any) -> None: def test_fail__valid_otg_id(arg: Any) -> None: with pytest.raises(ValidatorError): print(valid_otg_id(arg)) + + +# ===== [email protected]("arg", ["ECM ", "EeM ", "ncm ", " Rndis"]) +def test_ok__valid_otg_ethernet(arg: Any) -> None: + assert valid_otg_ethernet(arg) == arg.strip().lower() + + [email protected]("arg", ["test", "", None]) +def test_fail__valid_otg_ethernet(arg: Any) -> None: + with pytest.raises(ValidatorError): + print(valid_otg_ethernet(arg)) |