From e22797da28dca6cbe4b0e17cf5c1852698fd8a89 Mon Sep 17 00:00:00 2001 From: MauronMP Date: Wed, 16 Nov 2022 14:29:16 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(test=5Fpmp=5Fiv.py):=20Comrpue?= =?UTF-8?q?ba=20correlacion=20#26=20#31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_pmp_iv.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/test_pmp_iv.py b/tests/test_pmp_iv.py index 0b9d71b..90ad7a9 100644 --- a/tests/test_pmp_iv.py +++ b/tests/test_pmp_iv.py @@ -7,8 +7,7 @@ import pmp_iv.enums.month import pmp_iv.models.coordenada from pmp_iv.forest_prediction.eda import * -from pmp_iv.forest_prediction.model_building import * -import pmp_iv.enums.regression_algorithm +from pmp_iv.forest_prediction.correlacion_area import * from hamcrest import * MES_AGOSTO = 'aug' @@ -16,14 +15,15 @@ PROPIEDAD_VIENTO = 'wind' MIN_VIENTO = 0 MAX_VIENTO = 10 +MIN_CORRELACION = -1 +MAX_CORRELACION = 1 +MAXIMA_TEMPERATURA = 50 +MAXIMA_COORDENADA = 9 def test_syntaxis(): os.system("python3 -m compileall pmp_iv") def test_Constructores(): - MAXIMA_TEMPERATURA = 50 - MAXIMA_COORDENADA = 9 - assert_that(pmp_iv.models.coordenada.Coordenada(5,5), equal_to(pmp_iv.models.coordenada.Coordenada(5,5))) assert_that(pmp_iv.models.coordenada.Coordenada(5,5).x,less_than_or_equal_to(MAXIMA_COORDENADA)) assert_that(pmp_iv.models.fecha.Fecha(pmp_iv.enums.month.Month.julio,pmp_iv.enums.day.Day.L).mes,same_instance(pmp_iv.enums.month.Month.julio)) assert_that(pmp_iv.models.estado.Estado(10,10,9,3,200).temperature, less_than_or_equal_to(MAXIMA_TEMPERATURA)) @@ -38,5 +38,6 @@ def test_wind_filter(): for i in range(len(filtrado_mes_viento)): assert_that(float(filtrado_mes_viento[i][4]),less_than_or_equal_to(MAX_VIENTO) and greater_than(MIN_VIENTO)) -def test_regression_selected(): - assert_that(model_building().get_best_results(),anything(Regression_algorithm._member_names_)) \ No newline at end of file +def test_correlacion(): + assert_that(correlacion_dato_area(PROPIEDAD_VIENTO).calculo_coeficiente(), less_than_or_equal_to(MAXIMA_COORDENADA)) + assert_that(correlacion_dato_area(PROPIEDAD_VIENTO).calculo_coeficiente(), greater_than_or_equal_to(MIN_CORRELACION)) \ No newline at end of file