Skip to content

Commit

Permalink
✅ test(test_pmp_iv.py): Comrpueba correlacion #26 #31
Browse files Browse the repository at this point in the history
  • Loading branch information
MauronMP committed Nov 16, 2022
1 parent 894b416 commit e22797d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/test_pmp_iv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
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'
DIA_LUNES = 'mon'
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))
Expand All @@ -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_))
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))

0 comments on commit e22797d

Please sign in to comment.