Mercurial > templog
comparison py/test.py @ 148:b32e5a11a4cb
few updates, seems to run
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 15 Dec 2012 23:49:08 +0800 |
parents | 6517ddee3187 |
children | 185621f47040 |
comparison
equal
deleted
inserted
replaced
147:ab1e7bf77d69 | 148:b32e5a11a4cb |
---|---|
11 | 11 |
12 def test_sensors_regex(self): | 12 def test_sensors_regex(self): |
13 f1 = """6e 01 4b 46 7f ff 02 10 71 : crc=71 YES | 13 f1 = """6e 01 4b 46 7f ff 02 10 71 : crc=71 YES |
14 6e 01 4b 46 7f ff 02 10 71 t=22875 | 14 6e 01 4b 46 7f ff 02 10 71 t=22875 |
15 """ | 15 """ |
16 val = self.sensors.do_sensor_name('blank', f1) | 16 val = self.sensors.do_sensor('blank', f1) |
17 self.assertEqual(val, 22.875) | 17 self.assertEqual(val, 22.875) |
18 | 18 |
19 f2 = """6e 01 4b 46 7f ff 02 10 71 : crc=71 NO | 19 f2 = """6e 01 4b 46 7f ff 02 10 71 : crc=71 NO |
20 6e 01 4b 46 7f ff 02 10 71 t=22875 | 20 6e 01 4b 46 7f ff 02 10 71 t=22875 |
21 """ | 21 """ |
22 val = self.sensors.do_sensor_name('blank', f2) | 22 val = self.sensors.do_sensor('blank', f2) |
23 self.assertEqual(val, None) | 23 self.assertEqual(val, None) |
24 | 24 |
25 f3 = """6e 01 4b 46 7f ff 02 10 71 : crc=71 YES | 25 f3 = """6e 01 4b 46 7f ff 02 10 71 : crc=71 YES |
26 6e 01 4b 46 7f ff 02 10 71 t=-1 | 26 6e 01 4b 46 7f ff 02 10 71 t=-1 |
27 """ | 27 """ |
28 val = self.sensors.do_sensor_name('blank', f3) | 28 val = self.sensors.do_sensor('blank', f3) |
29 self.assertEqual(val, -0.001) | 29 self.assertEqual(val, -0.001) |
30 | 30 |
31 class TestParams(unittest.TestCase): | 31 class TestParams(unittest.TestCase): |
32 def setUp(self): | 32 def setUp(self): |
33 self.params = params.Params() | 33 self.params = params.Params() |