def test_measure_with_watering(self, start_water_mock): self.make_data_watering() tasks.meassure() water_id = self.db.session.query(WaterDevice).first().id start_water_mock.assert_called_once_with(water_id)
def test_meassure_multiple_flowers(self): self.make_data_session_flower_multiple() data_points_before = len(self.db.session.query(FlowerData).all()) tasks.meassure() data_points_after = len(self.db.session.query(FlowerData).all()) self.assertEqual(data_points_before, data_points_after - 2, "Wrong number of insertions in meassure")