Created
January 2, 2022 06:21
-
-
Save thuwarakeshm/aa10270925c42d31286dd906a28f12d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def fib(n: int): | |
return n if n < 2 else fib(n - 1) + fib(n - 2) | |
class TestFibonacciFunction(unittest.TestCase): | |
def test_big_fibonacci(self): | |
self.assertEqual(fib(10), 55) | |
def test_small_fibonacci(self): | |
self.assertEqual(fib(1), 1) | |
if __name__ == "__main__": | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment