Пример #1
0
 def test_values(self):
     s = model.Sensor(sensor_type=self.in_type, value=self.in_value)
     self.assertEqual(self.out_value, s.value)
Пример #2
0
 def test_values(self):
     s = model.Sensor(sensor_type=self.in_type, value=self.in_value)
     self.assertRaises(ValueError, getattr, s, 'value')
Пример #3
0
 def test_as_dict(self):
     objects.load()
     s = model.Sensor(**self.data)
     self.data.pop('uri', None)
     self.data.pop('type', None)
     self.assertEqual(self.data, s.as_dict(objects.registry.Sensor))