def main(): playing = True while playing: price = choose_random_price(prices) print(f'\nThe Purchase Price is ${price}.') payment = enter_payment(price) diff = calc_difference(price, payment) results = calc_change(diff) print_results(diff, results) playing = play_again()
def test_input_n(self, mock_input): play = play_again() self.assertEqual(play, False) self.assertEqual(sys.stdout.getvalue().strip(), "Thanks for playing!!")
def test_input_invlaid_space(self, mock_input): play = play_again() self.assertEqual(sys.stdout.getvalue().strip(), "Please enter 'Y' or 'N'.") self.assertEqual(play, True)
def test_input_y(self, mock_input): play = play_again() self.assertEqual(play, True)