Пример #1
0
 def setUp(self):
     self.temp_dir = tempfile.mkdtemp()
     self.sc = cchrc.sensors.SensorContainer()
     self.sc.put(MyTestSensor('T1'), 'TestGroup')
     self.sc.put(MyTestSensor('T2', increment_value=5), 'TestGroup')
     self.sc.put(MyTestSensor('T3', increment_value=10), 'TestGroup')
     self.sc.put(MyTestSensor('T4', increment_value=15), 'TestGroup')
     s = MyTestSensor('T5', increment_value=20)
     s.display_name = 'T5 Display'
     self.sc.put(s, 'TestGroup')
Пример #2
0
 def test_friendly_name_when_set(self):
     """Ensure getting friendly name when set returns friendly name"""
     s = MyTestSensor('NAME', 'id')
     s.display_name = 'FRIENDLY'
     self.assertEqual(s.display_name, 'FRIENDLY')