diff options
author | Devaev Maxim <[email protected]> | 2019-11-29 01:35:38 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-11-29 01:35:38 +0300 |
commit | 3d8f16b9c60cc2ef8547e62f968b5faedf1d8094 (patch) | |
tree | 4addbab851f2ad68932d88249ea812ac74b1d957 /testenv/tests/validators | |
parent | 51e15d01c28556f47be849604ee5e52f18ffdd5d (diff) |
wake-on-lan back
Diffstat (limited to 'testenv/tests/validators')
-rw-r--r-- | testenv/tests/validators/test_net.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_net.py b/testenv/tests/validators/test_net.py index eab67c9a..269db9e1 100644 --- a/testenv/tests/validators/test_net.py +++ b/testenv/tests/validators/test_net.py @@ -29,6 +29,7 @@ from kvmd.validators.net import valid_ip_or_host from kvmd.validators.net import valid_ip from kvmd.validators.net import valid_rfc_host from kvmd.validators.net import valid_port +from kvmd.validators.net import valid_mac # ===== @@ -120,3 +121,24 @@ def test_ok__valid_port(arg: Any) -> None: def test_fail__valid_port(arg: Any) -> None: with pytest.raises(ValidatorError): print(valid_port(arg)) + + +# ===== [email protected]("arg", [ + " 00:00:00:00:00:00 ", + " 9f:00:00:00:00:00 ", + " FF:FF:FF:FF:FF:FF ", +]) +def test_ok__valid_mac(arg: Any) -> None: + assert valid_mac(arg) == arg.strip().lower() + + [email protected]("arg", [ + "00:00:00:00:00:0", + "9x:00:00:00:00:00", + "", + None, +]) +def test_fail__valid_mac(arg: Any) -> None: + with pytest.raises(ValidatorError): + print(valid_mac(arg)) |