Ejemplo n.º 1
0
 def test_map_reports(self) -> None:
     with open(path("files/responses/livereport"), "r") as file:
         livereport = json.loads(file.read())
     reports = mapper.map_reports(livereport)
     self.assertEqual(5, len(reports))
     self.assertEqual("VRC700 MultiMatic", reports[0].device_name)
     self.assertEqual("Control_SYS_MultiMatic", reports[0].device_id)
     self.assertEqual("bar", reports[0].unit)
     self.assertEqual(1.9, reports[0].value)
     self.assertEqual("Water pressure", reports[0].name)
     self.assertEqual("WaterPressureSensor", reports[0].id)
Ejemplo n.º 2
0
 def test_map_reports(self) -> None:
     with open(path('files/responses/livereport'), 'r') as file:
         livereport = json.loads(file.read())
     reports = mapper.map_reports(livereport)
     self.assertEqual(5, len(reports))
     self.assertEqual('VRC700 MultiMatic', reports[0].device_name)
     self.assertEqual('Control_SYS_MultiMatic', reports[0].device_id)
     self.assertEqual('bar', reports[0].unit)
     self.assertEqual(1.9, reports[0].value)
     self.assertEqual('Water pressure', reports[0].name)
     self.assertEqual('WaterPressureSensor', reports[0].id)
Ejemplo n.º 3
0
 def test_map_reports_no_livereport(self) -> None:
     reports = mapper.map_reports(None)
     self.assertEqual(0, len(reports))