def final_order(self): self._strategy.order_type = self._order_type bp = self.calculate_bonus_pack() milk = bp * self._strategy.calculate_bonus_on('milk') dark = bp * self._strategy.calculate_bonus_on('dark') white = bp * self._strategy.calculate_bonus_on('white') bonus = [milk, dark, white] initial_purchase = self.calculate_initial_buy() adder = Adder(self._order_type, initial_purchase) self._adder_final_no_text = adder.adder(bonus) r = adder.adder(bonus) return 'milk {},dark {},white {}'.format(r[0], r[1], r[2])
def test_formatter(self): formatter = Adder('white', 3) print("test_formatter...\n\n") print(formatter.out) result = list(map(add, formatter.out, formatter.out)) self.assertEqual(result, formatter.adder(formatter.out))