def test_5(self): aux1 = Cars(marca='BMW') aux2 = Cars() aux_coches = [aux1, aux2] user = User('Pepito Los Palotes', '12345678P', '08390', '678942316', '*****@*****.**') x = Viajes(user=user, lista_pasajeros=['p1', 'p2', 'p3'], coches=aux_coches) datos = x.anadir_coche() x.anadir_coche = MagicMock(return_value=True) assert datos == x.anadir_coche()
def test_6(self): aux1 = Cars(marca='BMW') aux2 = Cars() aux_coches = [aux1, aux2] x = Viajes(user=User, lista_pasajeros=['p1', 'p2', 'p3'], coches=aux_coches) aux = User('Pepito Los Palotes', '12345678P', '08390', '678942316', '*****@*****.**') fallo = x.anadir_coche(1) rentalcars = Rentalcars() rentalcars.confirm_reserve = MagicMock(return_value=False) assert rentalcars.confirm_reserve(aux, aux_coches) == fallo