def test_afegir_vol_calcular_import(self): p = Viatgers(3) past = p.get_num_viatgers() f1 = Vol("CODIGO1", "MILAN", past, 25.0) f2 = Vol("CODIGO2", "BARCELONA", past, 19.0) f3 = Vol("CODIGO3", "PARIS", past, 32.0) vols = [f1, f2] v = Flights(past, vols) v.afegeix_desti(f3) self.assertEqual(v.calcul_import_total_vols(), 228.0)
def test_afegir_vol_llista_vols(self): p = Viatgers(3) past = p.get_num_viatgers() f1 = Vol("CODIGO1", "MILAN", past, 25.0) f2 = Vol("CODIGO2", "BARCELONA", past, 19.0) f3 = Vol("CODIGO3", "PARIS", past, 32.0) vols = [f1, f2] v = Flights(past, vols) v.afegeix_desti(f3) test_llista_vols = [f1, f2, f3] self.assertEqual(v.get_llista_vols(), test_llista_vols)