def test_fetch_consumption_ES_IB_FO(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses data_list = ES_IB.fetch_consumption('ES-IB-FO', self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data['zoneKey'], 'ES-IB-FO') self.assertEqual(data['source'], 'demanda.ree.es') self.assertIsNotNone(data['datetime']) self.assertIsNotNone(data['consumption'])
def test_fetch_consumption_ES_IB_FO(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses data_list = ES_IB.fetch_consumption("ES-IB-FO", self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data["zoneKey"], "ES-IB-FO") self.assertEqual(data["source"], "demanda.ree.es") self.assertIsNotNone(data["datetime"]) self.assertIsNotNone(data["consumption"])
def test_fetch_exchange_ES_IB_FO(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses data_list = ES_IB.fetch_exchange('ES-IB-FO', 'ES-IB-IZ', self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data['sortedZoneKeys'], 'ES-IB-FO->ES-IB-IZ') self.assertEqual(data['source'], 'demanda.ree.es') self.assertIsNotNone(data['netFlow']) self.assertEqual(data['netFlow'], -10.0) self.assertIsNotNone(data['datetime'])
def test_fetch_exchange_ES_IB_FO(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses data_list = ES_IB.fetch_exchange("ES-IB-FO", "ES-IB-IZ", self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data["sortedZoneKeys"], "ES-IB-FO->ES-IB-IZ") self.assertEqual(data["source"], "demanda.ree.es") self.assertIsNotNone(data["netFlow"]) self.assertEqual(data["netFlow"], -10.0) self.assertIsNotNone(data["datetime"])
def test_fetch_consumption(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses try: data_list = ES_IB.fetch_consumption('ES-IB', self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data['countryCode'], 'ES-IB') self.assertEqual(data['source'], 'demanda.ree.es') self.assertIsNotNone(data['datetime']) self.assertIsNotNone(data['consumption']) except Exception as ex: self.fail(ex.message)
def test_fetch_consumption(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses try: data_list = ES_IB.fetch_consumption('ES-IB', self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data['zoneKey'], 'ES-IB') self.assertEqual(data['source'], 'demanda.ree.es') self.assertIsNotNone(data['datetime']) self.assertIsNotNone(data['consumption']) except Exception as ex: self.fail(ex.message)
def test_fetch_exchange(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses try: data_list = ES_IB.fetch_exchange('ES', 'ES-IB', self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data['sortedCountryCodes'], 'ES->ES-IB') self.assertEqual(data['source'], 'demanda.ree.es') self.assertIsNotNone(data['netFlow']) self.assertEqual(data['netFlow'], 50.0) self.assertIsNotNone(data['datetime']) except Exception as ex: self.fail(ex.message)
def test_fetch_exchange(self, mocked_get_all): mocked_get_all.return_value = self.mocked_responses try: data_list = ES_IB.fetch_exchange('ES', 'ES-IB', self.session) self.assertIsNotNone(data_list) for data in data_list: self.assertEqual(data['sortedZoneKeys'], 'ES->ES-IB') self.assertEqual(data['source'], 'demanda.ree.es') self.assertIsNotNone(data['netFlow']) self.assertEqual(data['netFlow'], 50.0) self.assertIsNotNone(data['datetime']) except Exception as ex: self.fail(ex.message)