Пример #1
0
    def test_bikeshop_markup(self):

        bianchi = Bicycle("Bianchi", 6, 450.0)
        rock_star = Bikeshop(
            " Rock Star", {"bianchi": 2, "schwinn": 5, "abici": 7, "cinelli": 1, "eagle": 2, "falcon": 6}
        )

        self.assertEqual(rock_star.calculate_bike_cost(bianchi), 450 * 1.2)
Пример #2
0
    def test_customer_can_afford_a_bike(self):
        ramona = Customer(name='Ramona', budget=200.0)
        rock_star = Bikeshop(' Rock Star', {'bianchi': 2, 'schwinn': 5, 'abici': 7, 'cinelli': 1, 'eagle': 2, 'falcon': 6})
        bianchi = Bicycle('Bianchi', 6, 450.0)
        schwinn = Bicycle('Schwinn', 10, 100.0)
        abici = Bicycle('Abici', 5, 300.0)
        cinelli = Bicycle('Cinelli', 4, 400.0)
        eagle = Bicycle('Eagle', 6, 200.0)
        falcon = Bicycle('Falcon', 7, 930.0)
        bike_list = [bianchi, schwinn, abici, cinelli, eagle, falcon]

        # if ramona.budget >= rock_star.calculate_bike_cost(bianchi): 
        #   return True 
        # else: 
        #   return False 
        self.assertEqual(len(rock_star.check_budget(ramona, bike_list)), 1)
Пример #3
0
    def test_customer_can_afford_a_bike(self):
        ramona = Customer(name="Ramona", budget=200.0)
        rock_star = Bikeshop(
            " Rock Star", {"bianchi": 2, "schwinn": 5, "abici": 7, "cinelli": 1, "eagle": 2, "falcon": 6}
        )
        bianchi = Bicycle("Bianchi", 6, 450.0)
        schwinn = Bicycle("Schwinn", 10, 100.0)
        abici = Bicycle("Abici", 5, 300.0)
        cinelli = Bicycle("Cinelli", 4, 400.0)
        eagle = Bicycle("Eagle", 6, 200.0)
        falcon = Bicycle("Falcon", 7, 930.0)
        bike_list = [bianchi, schwinn, abici, cinelli, eagle, falcon]

        # if ramona.budget >= rock_star.calculate_bike_cost(bianchi):
        #   return True
        # else:
        #   return False
        self.assertEqual(len(rock_star.check_budget(ramona, bike_list)), 1)
Пример #4
0
 def test_bikeshop_has_six_models(self):
     rock_star = Bikeshop(' Rock Star', {'bianchi': 2, 'schwinn': 5, 'abici': 7, 'cinelli': 1, 'eagle': 2, 'falcon': 6})
     self.assertEqual(len(rock_star.inventory), 6)
Пример #5
0
    def test_bikeshop_markup(self):
        
        bianchi = Bicycle('Bianchi', 6, 450.0)
        rock_star = Bikeshop(' Rock Star', {'bianchi': 2, 'schwinn': 5, 'abici': 7, 'cinelli': 1, 'eagle': 2, 'falcon': 6})

        self.assertEqual (rock_star.calculate_bike_cost(bianchi), 450 * 1.2)