diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-01-29 13:29:42 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-01-29 13:29:42 +0100 |
commit | 18afba9273d1fa2cce2ed66f8c5f102e59fa962f (patch) | |
tree | 0211cfe58a707a28144112c101d155fdd9608c9b /bin/test.py | |
parent | f931a9cce20cb1c719e793b7b7c6494ade9ae21f (diff) |
add parameter look-up table models
Diffstat (limited to 'bin/test.py')
-rwxr-xr-x | bin/test.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/test.py b/bin/test.py index 6ac9942..71c02bd 100755 --- a/bin/test.py +++ b/bin/test.py @@ -60,6 +60,14 @@ class TestStaticModel(unittest.TestCase): self.assertAlmostEqual(static_model('off', 'duration'), 9130, places=0) self.assertAlmostEqual(static_model('setBrightness', 'duration'), 9130, places=0) + param_lut_model = model.get_param_lut() + self.assertAlmostEqual(param_lut_model('OFF', 'power', param=[None, None]), 7124, places=0) + with self.assertRaises(KeyError): + param_lut_model('ON', 'power', param=[None, None]) + param_lut_model('ON', 'power', param=['a']) + param_lut_model('ON', 'power', param=[0]) + self.assertTrue(param_lut_model('ON', 'power', param=[0, 0])) + def test_model_multifile_lm75x(self): testfiles = [ '../data/20170116_124500_LM75x.tar', |