Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)