From 1de8a954c56be99140915a4fa4cac80a5dd43eb5 Mon Sep 17 00:00:00 2001 From: Ruben1700 Date: Tue, 1 Oct 2024 13:05:47 +0200 Subject: [PATCH 1/4] Indicadores PMD, DSVB i DSVS --- esios/indicators.py | 9 +++++++++ spec/indicators_spec.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/esios/indicators.py b/esios/indicators.py index 6b7d3e7..f19892d 100644 --- a/esios/indicators.py +++ b/esios/indicators.py @@ -277,3 +277,12 @@ class PriceMedioHorarioAJOMcur(Indicator): class PriceSRAD(Indicator): path = 'indicators/1930' + +class PrecioMercadoDiario(Indicator): + path = 'indicators/600' + +class PrecioDesviosSubir(Indicator): + path = 'indicators/686' + +class PrecioDesviosBajar(Indicator): + path = 'indicators/687' \ No newline at end of file diff --git a/spec/indicators_spec.py b/spec/indicators_spec.py index 9ad1dc1..098c581 100644 --- a/spec/indicators_spec.py +++ b/spec/indicators_spec.py @@ -928,3 +928,39 @@ expect(data['indicator']['name']).to( contain(u'Precio marginal en el servicio de respuesta activa de la demanda') ) + + with it('Returns PrecioMercadoDiario instance'): + e = Esios(self.token) + profile = PrecioMercadoDiario(e) + assert isinstance(profile, PrecioMercadoDiario) + data = profile.get(self.start_date, self.end_date) + expect(data['indicator']['short_name']).to( + equal(u'Mercado SPOT') + ) + expect(data['indicator']['name']).to( + contain(u'Mercado SPOT') + ) + + with it('Returns PrecioDesviosSubir instance'): + e = Esios(self.token) + profile = PrecioDesviosSubir(e) + assert isinstance(profile, PrecioDesviosSubir) + data = profile.get(self.start_date, self.end_date) + expect(data['indicator']['short_name']).to( + equal(u'Desvíos a subir') + ) + expect(data['indicator']['name']).to( + contain(u'Desvíos a subir') + ) + + with it('Returns PrecioDesviosBajar instance'): + e = Esios(self.token) + profile = PrecioDesviosBajar(e) + assert isinstance(profile, PrecioDesviosBajar) + data = profile.get(self.start_date, self.end_date) + expect(data['indicator']['short_name']).to( + equal(u'Desvíos a bajar') + ) + expect(data['indicator']['name']).to( + contain(u'Desvíos a bajar') + ) \ No newline at end of file From 147eeaaa4d101e5c5c3d247cea74446e252cf9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rqui=C3=B1ones?= <92431809+Ruben1700@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:28:10 +0200 Subject: [PATCH 2/4] Tests --- spec/indicators_spec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/indicators_spec.py b/spec/indicators_spec.py index 098c581..b8e5e45 100644 --- a/spec/indicators_spec.py +++ b/spec/indicators_spec.py @@ -938,7 +938,7 @@ equal(u'Mercado SPOT') ) expect(data['indicator']['name']).to( - contain(u'Mercado SPOT') + contain(u'Precio mercado SPOT Diario') ) with it('Returns PrecioDesviosSubir instance'): @@ -950,7 +950,7 @@ equal(u'Desvíos a subir') ) expect(data['indicator']['name']).to( - contain(u'Desvíos a subir') + contain(u'Precio de cobro desvíos a subir') ) with it('Returns PrecioDesviosBajar instance'): @@ -962,5 +962,5 @@ equal(u'Desvíos a bajar') ) expect(data['indicator']['name']).to( - contain(u'Desvíos a bajar') + contain(u'Precio de cobro desvíos a subir') ) \ No newline at end of file From 3922b40acab6f1fa3489a55dcf1ea8f7cadc0c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rqui=C3=B1ones?= <92431809+Ruben1700@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:31:13 +0200 Subject: [PATCH 3/4] Typo --- spec/indicators_spec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/indicators_spec.py b/spec/indicators_spec.py index b8e5e45..c8625aa 100644 --- a/spec/indicators_spec.py +++ b/spec/indicators_spec.py @@ -962,5 +962,5 @@ equal(u'Desvíos a bajar') ) expect(data['indicator']['name']).to( - contain(u'Precio de cobro desvíos a subir') + contain(u'Precio de cobro desvíos a bajar') ) \ No newline at end of file From befb8b89ec2c92e94bc791f50f589af8dbaad14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rqui=C3=B1ones?= <92431809+Ruben1700@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:33:30 +0200 Subject: [PATCH 4/4] typo v2 --- spec/indicators_spec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/indicators_spec.py b/spec/indicators_spec.py index c8625aa..c99649b 100644 --- a/spec/indicators_spec.py +++ b/spec/indicators_spec.py @@ -962,5 +962,5 @@ equal(u'Desvíos a bajar') ) expect(data['indicator']['name']).to( - contain(u'Precio de cobro desvíos a bajar') + contain(u'Precio de pago desvíos a bajar') ) \ No newline at end of file