Beispiel #1
0
 def test_input_range_one_to_ten_outputs_correctly(self):
     expected = "1\n2\nThree\n4\nFive\nThree\n7\n8\nThree\nFive\n"
     with patch("sys.stdout", new=io.StringIO()) as fake_out:
         three_five_print(lower=1, upper=11)
         self.assertEqual(fake_out.getvalue(), expected)
Beispiel #2
0
 def test_input_1_outputs_1(self):
     expected = "1\n"
     with patch("sys.stdout", new=io.StringIO()) as fake_out:
         three_five_print(lower=1, upper=2)
         self.assertEqual(fake_out.getvalue(), expected)
Beispiel #3
0
 def test_input_str_4_outputs_empty(self):
     expected = ""
     with patch("sys.stdout", new=io.StringIO()) as fake_out:
         three_five_print(lower=3, upper="4")
         self.assertEqual(fake_out.getvalue(), expected)
Beispiel #4
0
 def test_input_15_outputs_correctly(self):
     expected = "ThreeFive\n"
     with patch("sys.stdout", new=io.StringIO()) as fake_out:
         three_five_print(lower=15, upper=16)
         self.assertEqual(fake_out.getvalue(), expected)