コード例 #1
0
ファイル: test_fizzbuzz.py プロジェクト: tapiwa03/fizzbuzz
 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()
コード例 #2
0
ファイル: test_fizzbuzz.py プロジェクト: tapiwa03/fizzbuzz
 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",
         )
コード例 #3
0
from fizzbuzz.app import run

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