class BicycleManufacturerTest(unittest.TestCase): def setUp(self): self._manufacturer = BicycleManufacturer("Manufacturer", 0.2) def test_generate_bikes(self): bikes = self._manufacturer.generate_bikes() self.assertEqual(len(bikes), 3)
# This module contains the script that shows an example run of the models from model import BicycleManufacturer, BicycleShop, Customer if __name__ == "__main__": manufacturer1 = BicycleManufacturer("Manufacturer 1", 0.1) manufacturer2 = BicycleManufacturer("Manufacturer 2", 0.2) shop = BicycleShop("Freecycle", 0.2, [manufacturer1, manufacturer2]) shop.get_inventory() customer1 = Customer("Customer 1", 200) customer2 = Customer("Customer 2", 500) customer3 = Customer("Customer 3", 1000) customerList = [customer1, customer2, customer3] print "\n" print "====" * 5 print "Welcome to {0}".format(shop.get_name()) print "====" * 5 print "\nCurrent Inventory:" print "-----" * 5 for bike in shop.get_inventory(): print "{0}".format(bike) for customer in customerList: print "\n{0}".format(customer) temp = [] for bike in shop.get_inventory(): if (bike.get_cost() <= customer.get_funds()):
def setUp(self): self._manufacturer = BicycleManufacturer("Manufacturer", 0.2)
def setUp(self): self._manufacturer1 = BicycleManufacturer("Manufacturer1", 0.2) self._manufacturer2 = BicycleManufacturer("Manufacturer2", 0.3) self._shop = BicycleShop("Shop", 0.2, [self._manufacturer1, self._manufacturer2]) self._customer = Customer('Customer', 10000)