def test_returnBike(self): shop = Bikerental(10) cus1 = Customer() cus1.rental_time = datetime.now() + timedelta(hours=-4) cus1.rental_basis = 1 cus1.no_of_bikes = 1 request = cus1.return_bike() self.assertEqual(shop.returnBike(request), 20)
def test_return_bike(self): customer = Customer() now = datetime.now() customer.rental_time = now customer.rental_basis = 1 customer.no_of_bikes = 4 self.assertEqual(customer.return_bike(), (now, 1, 4))
def test_returnBike_for_invalid_no_ofBikes(self): shop = Bikerental(2) cus = Customer() cus.rental_basis = 3 cus.rental_time = datetime.now() cus.no_of_bikes = 4 request = cus.return_bike() self.assertEqual(shop.returnBike(request), 0)