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()
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", )
from fizzbuzz.app import run run()
def test_fizzbuzz_render_100(): assert app.run(100) == 'Buzz'
def test_fizzbuzz_render_15(): assert app.run(15) == 'FizzBuzz'
def test_fizzbuzz_render_five(): assert app.run(5) == 'Buzz'
def test_fizzbuzz_render_50(): assert app.run(50) == 'Buzz'
def test_fizzbuzz_render_twelve(): assert app.run(12) == 'Fizz'
def test_fizzbuzz_render_six(): assert app.run(6) == 'Fizz'
def test_fizzbuzz_render_three(): assert app.run(3) == 'Fizz'
def test_fizzbuzz_render_zero(): assert app.run(0) == 0
def test_fizzbuzz_render_number(): assert app.run(1) == 1