Beispiel #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()
Beispiel #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",
         )
Beispiel #3
0
from fizzbuzz.app import run

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