def test_fib(self):
     self.assertEqual(sample.fib(0),0)
     self.assertEqual(sample.fib(1),1)
     self.assertEqual(sample.fib(2),1)
     self.assertEqual(sample.fib(6),8)
Exemple #2
0
import pyximport
pyximport.install()

import sample

sample.fib(10)
Exemple #3
0
import bitey
import sample

for n in range(1, 10):
    print sample.fact(n), sample.fib(n)
Exemple #4
0
import bitey
import sample

for n in range(1,10):
    print sample.fact(n), sample.fib(n)
Exemple #5
0
def test_average():
    f = islice(fib(), 1, 10)
    assert average(f) == 15.777