Ejemplo n.º 1
0
 def test_run_function_returns_errors_when_invalid_args_passed(self):
     """
     Test that the run function runs and prints
     """
     testargs = ["main.py", 1, 2, 3, 4]
     with patch.object(sys, "argv", testargs):
         with self.assertRaises(Exception):
             run()
Ejemplo n.º 2
0
 def test_run_function_accepts_args(self):
     """
     Test that the run function runs and prints
     """
     testargs = ["main.py", "1", "3"]
     with patch.object(sys, "argv", testargs):
         self.assertEqual(
             run(),
             "Success",
             "The run function did not go all the way through",
         )
Ejemplo n.º 3
0
from fizzbuzz.app import run

run()
Ejemplo n.º 4
0
def test_fizzbuzz_render_100():
    assert app.run(100) == 'Buzz'
Ejemplo n.º 5
0
def test_fizzbuzz_render_15():
    assert app.run(15) == 'FizzBuzz'
Ejemplo n.º 6
0
def test_fizzbuzz_render_five():
    assert app.run(5) == 'Buzz'
Ejemplo n.º 7
0
def test_fizzbuzz_render_50():
    assert app.run(50) == 'Buzz'
Ejemplo n.º 8
0
def test_fizzbuzz_render_twelve():
    assert app.run(12) == 'Fizz'
Ejemplo n.º 9
0
def test_fizzbuzz_render_six():
    assert app.run(6) == 'Fizz'
Ejemplo n.º 10
0
def test_fizzbuzz_render_three():
    assert app.run(3) == 'Fizz'
Ejemplo n.º 11
0
def test_fizzbuzz_render_zero():
    assert app.run(0) == 0
Ejemplo n.º 12
0
def test_fizzbuzz_render_number():
    assert app.run(1) == 1