Esempio n. 1
0
def test_should_fizzify_n_numbers_correctly(n, expected):
    assert fizzbuzz(n) == expected
Esempio n. 2
0
def test_fizzbuzz_is_generator():
    actual_results = fizzbuzz(5)
    assert isinstance(actual_results, types.GeneratorType)
Esempio n. 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"
Esempio n. 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")
Esempio n. 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")
Esempio n. 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)