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

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