Esempio n. 1
0
def test_fizz_buzz():
    assert fizz_buzz(2) == [1, 2]
    assert fizz_buzz(4) == [1, 2, 'fizz', 4]
    assert fizz_buzz(8) == [1, 2, 'fizz', 4, 'buzz', 'fizz', 7, 8]
    assert fizz_buzz(9) == [1, 2, 'fizz', 4, 'buzz', 'fizz', 7, 8, 'fizz']
    assert fizz_buzz(33) == [1, 2, 'fizz', 4, 'buzz', 'fizz', 7, 8,
                             'fizz', 'buzz', 11, 'fizz', 13, 14,
                             'fizzbuzz', 16, 17, 'fizz', 19, 'buzz',
                             'fizz', 22, 23, 'fizz', 'buzz', 26, 'fizz',
                             28, 29, 'fizzbuzz', 31, 32, 'fizz']
Esempio n. 2
0
def test_fizz_buzz():
    output = [
        1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13,
        14, "Fizz Buzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz",
        "Buzz", 26, "Fizz", 28, 29, "Fizz Buzz", 31, 32, "Fizz", 34, "Buzz",
        "Fizz"
    ]
    assert fizz_buzz(37) == output
Esempio n. 3
0
def test_fizz_buzz5():
    assert [
        1, 2, "fizz", 4, "buzz", "fizz", 7, 8, "fizz", "buzz", 11, "fizz", 13,
        14, "fizzbuzz"
    ] == fizz_buzz(15)
Esempio n. 4
0
def test_fizz_buzz4():
    assert [1, 2, "fizz", 4, "buzz", "fizz", 7, 8, "fizz",
            "buzz"] == fizz_buzz(10)
Esempio n. 5
0
def test_fizz_buzz3():
    assert [1, 2, "fizz", 4, "buzz"] == fizz_buzz(5)
Esempio n. 6
0
def test_fizz_buzz2():
    assert [1, 2, "fizz", 4] == fizz_buzz(4)
Esempio n. 7
0
def test_fizz_buzz():
    assert [1] == fizz_buzz(1)
Esempio n. 8
0
def test_fizz_buzz():
    assert fizz_buzz(20) == [1,2,'Fizz',4,'Buzz','Fizz',7,8,'Fizz','Buzz',11,'Fizz',13,14,'FizzBuzz',16,17,'Fizz',19,'Buzz']
def test_fizz_buzz_high():
    assert fizz_buzz(500)[-1] == 'Buzz'
def test_fizz_buzz():
    assert fizz_buzz(5) == [1, 2, 'Fizz', 4, 'Buzz']