def testTarifaMax(self): tari = Tarifa(257698037700, 257698037700) tiempo = [ datetime(year=2015, month=1, day=1), datetime(year=2015, month=1, day=8) ] calcularPrecio(tari, tiempo)
def testTarifaCero(self): tari = Tarifa(0, 0) tiempo = [ datetime(year=2015, month=1, day=1), datetime(year=2015, month=1, day=3) ] resultado = calcularPrecio(tari, tiempo) assert resultado == 0.00
def testLetras(self): calcularPrecio('a', 'b')
def testFaltan20ParaLasDoce(self): tarifa = tarea2.Tarifa(1,2) i,f=datetime(2015,12,31,23,40),datetime(2016,1,1,0,0) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(1,monto)
def testCeroMinutos(self): tarifa = tarea2.Tarifa(1,2) i,f=datetime(2016,5,2,23,0),datetime(2016,5,2,23,0) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(0,monto)
def testSeisDiasYUnMinuto(self): tarifa = tarea2.Tarifa(1,2) i,f=datetime(2016,4,28,0,0),datetime(2016,5,4,0,1) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(193,monto)
def test24HorasBordesSemana(self): tarifa = tarea2.Tarifa(1,2) i,f=datetime(2016,5,2,0,1),datetime(2016,5,2,23,59) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(24,monto)
def testQuinceMinutosEntreDomingoYLunes(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2016,4,10,23,53),datetime(2016,4,11,0,8) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(60,monto)
def testSieteDiasYUnMinuto(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2016,4,28,0,0),datetime(2016,5,5,0,1) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(0,monto)
def testQuinceMinutosEntreViernesYSabado(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2016,4,8,23,53),datetime(2016,4,9,0,8) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(60,monto)
def testMenosDeQuinceMinutos(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2016,5,5,0,0),datetime(2016,5,5,0,10) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(0,monto)
def testAniosDistintos(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2007,12,28,3,0),datetime(2008,1,2,21,0) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(3720,monto)
def testMesesDistintos(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2007,8,28,4,0),datetime(2007,9,2,21,0) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(3640,monto)
def testFechaInicioMayorFechaFinal(self): tarifa = tarea2.Tarifa(20,40) i,f=datetime(2016,5,5,0,0),datetime(2016,4,28,0,0) monto=tarea2.calcularPrecio(tarifa,[i,f]) self.assertEqual(0,monto)