示例#1
0
def test_should_fizzify_n_numbers_correctly(n, expected):
    assert fizzbuzz(n) == expected
示例#2
0
def test_fizzbuzz_is_generator():
    actual_results = fizzbuzz(5)
    assert isinstance(actual_results, types.GeneratorType)
示例#3
0
def test_fizzbuzz_is_fizzbuzz():
    N = 45
    actual_results = list(fizzbuzz(N))
    for i in range(15, N + 1, 15):
        assert actual_results[i - 1] == "fizzbuzz"
示例#4
0
def test_fizzbuzz_is_buzz():
    N = 15
    actual_results = list(fizzbuzz(N))
    for i in range(5, N + 1, 5):
        assert actual_results[i - 1].endswith("buzz")
示例#5
0
def test_fizzbuzz_is_fizz():
    N = 15
    actual_results = list(fizzbuzz(N))
    for i in range(3, N + 1, 3):
        assert actual_results[i - 1].startswith("fizz")
示例#6
0
# coding: utf-8
import sys
from solution import fizzbuzz

if __name__ == "__main__":
    if len(sys.argv) != 3:
        print("Usage: .py <int> <int>")
        sys.exit(1)
    
    
    begin = int(sys.argv[1])
    end = int(sys.argv[2])
    # Call the function
    fizzbuzz(begin, end)