daemon: removed utils.validate_mac and shifted tests to test_nodes

This commit is contained in:
Blake Harnden 2020-06-19 15:41:41 -07:00
parent 0d4a360e89
commit adfce52632
3 changed files with 14 additions and 40 deletions

View file

@ -1,8 +1,6 @@
import netaddr
import pytest
from core import utils
from core.errors import CoreError
class TestUtils:
@ -25,24 +23,6 @@ class TestUtils:
assert len(two_args) == 2
assert len(unicode_args) == 3
@pytest.mark.parametrize(
"data,expected",
[
("AA-AA-AA-FF-FF-FF", "aa:aa:aa:ff:ff:ff"),
("00:00:00:FF:FF:FF", "00:00:00:ff:ff:ff"),
],
)
def test_validate_mac(self, data: str, expected: str):
value = utils.validate_mac(data)
assert value == expected
@pytest.mark.parametrize(
"data", ["AAA:AA:AA:FF:FF:FF", "AA:AA:AA:FF:FF", "AA/AA/AA/FF/FF/FF"]
)
def test_validate_mac_exception(self, data: str):
with pytest.raises(CoreError):
utils.validate_mac(data)
def test_random_mac(self):
value = utils.random_mac()
assert netaddr.EUI(value) is not None