Exemple #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()
Exemple #2
0
 def test_inputBegin_0(self, mock_input):
     number = enter_a_number(0)
     self.assertEqual(sys.stdout.getvalue().strip(),
                      "Error! Enter a higher number.")
     self.assertEqual(number, 2)
Exemple #3
0
 def test_input_special(self, mock_input):
     number = enter_a_number(0)
     self.assertEqual(sys.stdout.getvalue().strip(),
                      "Error! Enter a whole number!")
     self.assertEqual(number, 2)
Exemple #4
0
 def test_inputEnd_greaterThenBegin(self, mock_input):
     number = enter_a_number(1)
     self.assertEqual(number, 5)
Exemple #5
0
 def test_inputEnd_lessThenBegin(self, mock_input):
     number = enter_a_number(2)
     self.assertEqual(sys.stdout.getvalue().strip(),
                      "Error! Enter a higher number.")
     self.assertEqual(number, 5)
Exemple #6
0
 def test_inputBegin_multipleDigits(self, mock_input):
     number = enter_a_number(0)
     self.assertEqual(number, 53)
Exemple #7
0
 def test_inputBegin_singleDigit(self, mock_input):
     number = enter_a_number(0)
     self.assertEqual(number, 7)