Example #1
0
 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'])
Example #2
0
 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'])
Example #3
0
 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"])
Example #4
0
 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'])
Example #5
0
 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'])
Example #6
0
 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"])
Example #7
0
 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)
Example #8
0
 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)
Example #9
0
 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)
Example #10
0
 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)