コード例 #1
0
def start():
    playing = True
    while playing:
        first = 0

        print("\nEnter the Starting number")
        begin = enter_a_number(first)

        print("\nEnter the Ending number")
        end = enter_a_number(begin)

        fizzBuzz_list = number_genterator(begin, end)
        print_list(fizzBuzz_list)
        count_print_fizzbuzz(fizzBuzz_list)
        playing = play_again()
コード例 #2
0
 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)
コード例 #3
0
 def test_input_n(self, mock_input):
     play = play_again()
     self.assertEqual(play, False)
     self.assertEqual(sys.stdout.getvalue().strip(), "Thanks for playing!!")
コード例 #4
0
 def test_input_y(self, mock_input):
     play = play_again()
     self.assertEqual(play, True)