test_mac_address.py 479 B

123456789101112131415161718
  1. import pytest
  2. import switchbot_mqtt
  3. @pytest.mark.parametrize(
  4. ("mac_address", "valid"),
  5. [
  6. ("aa:bb:cc:dd:ee:ff", True),
  7. ("AA:BB:CC:DD:EE:FF", True),
  8. ("AA:12:34:45:67:89", True),
  9. ("aabbccddeeff", False), # not supported by PySwitchbot
  10. ("aa:bb:cc:dd:ee:gg", False),
  11. ],
  12. )
  13. def test__mac_address_valid(mac_address, valid):
  14. # pylint: disable=protected-access
  15. assert switchbot_mqtt._mac_address_valid(mac_address) == valid