Exemplo n.º 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')
Exemplo n.º 2
0
 def test_normal_name(self):
     """Ensure name can be set and returned"""
     s = MyTestSensor('NAME', 'id')
     s.name = 'NAME2'
     self.assertEqual(s.name, 'NAME2')
Exemplo n.º 3
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')