1
0

test_pycc1101.py 468 B

1234567891011121314151617181920
  1. """
  2. run tests via pytest / pytest-3 command
  3. """
  4. import pytest
  5. from pycc1101.pycc1101 import TICC1101
  6. @pytest.mark.parametrize(
  7. ("freq_mhz", "control_words"),
  8. [
  9. (433, (0x10, 0xA7, 0x62)),
  10. (433.42, (0x10, 0xAB, 0x85)),
  11. (434, (0x10, 0xB1, 0x3B)),
  12. (868, (0x21, 0x62, 0x76)),
  13. ],
  14. )
  15. def test_compute_frequency_control_words(freq_mhz, control_words):
  16. assert TICC1101._computeFrequencyControlWords(freq_mhz) == control_words