Exemple #1
0
def test_fb(capsys):
    fb.fizzbuzz()
    out, err = capsys.readouterr()
    assert err == ''
    with open('expected.txt') as fh:
        expected = fh.read()
    assert out == expected
Exemple #2
0
def test_fizzbuzz_5div_returns_buzz(num):
    assert fizzbuzz(num) == 'buzz'
Exemple #3
0
def test_fizzbuzz_regular_returns_self(num):
    assert fizzbuzz(num) == str(num)
def test_fizzbuzz_returns_str():
    assert isinstance(fizzbuzz(1), str)
def test_fizzbuzz_3div_5div_returs_fizzbuzz(num):
    assert fizzbuzz(num) == 'fizzbuzz'
def test_fizzbuzz_non_mod3_non_mod5_returns_self(num):
    assert fizzbuzz(num) == str(num)
def test_fizzbuzz_15_returns_fizzbuzz(num):
    assert fizzbuzz(num) == 'fizzbuzz'
Exemple #8
0
 def test_buzz(self):
     for i in [5, 10, 50]:
         print('testing', i)
         assert fizzbuzz(i) == 'Buzz'
Exemple #9
0
 def test_fizz(self):
     self.assertEquals("Fizz", fizzbuzz(3))
Exemple #10
0
 def test_buzz(self):
     self.assertEquals("Buzz",fizzbuzz(5))
Exemple #11
0
 def test_neither(self):
     self.assertEquals(2, fizzbuzz(2))
Exemple #12
0
def test_fizzbuzz_3and5div_returns_fizzbuzz(num):
    assert fizzbuzz(num) == 'fizzbuzz'
Exemple #13
0
 def test_fizz(self):
     for i in [3, 6, 9, 18]:
         print('testing', i)
         assert fizzbuzz(i) == 'Fizz'
Exemple #14
0
 def test_fizzbuzz(self):
     for i in [15, 30, 75]:
         print('testing', i)
         assert fizzbuzz(i) == 'FizzBuzz'
Exemple #15
0
def test_fizzbuzz_5_3div_returns_fizzbuzz(num):
    assert fizzbuzz(num) == 'fizzbuzz'
def test_fizzbuzz_3div_5div_returns_fizzbuzz(num):
    assert fizzbuzz(num) == "fizzbuzz"
Exemple #17
0
def test_fizzbuzz_return_str():
    assert isinstance(fizzbuzz(1), str)  # výsledek funkce je instancí stringů
Exemple #18
0
def test_fizzbuzz_15div_return_fizzbuzz(num):
    assert fizzbuzz(num) == 'fizzbuzz'