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)
def test_add_sale(self): grocery = Grocerystats('fruit') grocery.add_sale() grocery.add_sale() self.assertEqual(grocery.total_sales, 2)