Exemple #1
0
    def test_calculate_average(self):
        grocery = Grocerystats('fruit')
        grocery.add_quantity(1)
        grocery.add_quantity(1)
        grocery.add_quantity(1)
        grocery.add_quantity(1)
        grocery.add_sale()
        grocery.add_sale()

        self.assertEqual(grocery.calculate_average(), 2)
Exemple #2
0
    def test_add_quantity(self):
        grocery = Grocerystats('fruit')
        grocery.add_quantity(1)
        grocery.add_quantity(1)

        self.assertEqual(grocery.total_quantity, 2)