Last active
August 29, 2015 13:57
-
-
Save GerganaPetrova/9481236 to your computer and use it in GitHub Desktop.
happy_numbers_test
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 | |
from solution import is_happy, happy_primes | |
class TestHappy(unittest.TestCase): | |
def test_is_happy7(self): | |
self.assertEqual(is_happy(7), True) | |
def test_is_happy10(self): | |
self.assertEqual(is_happy(10), True) | |
def test_is_happ11(self): | |
self.assertEqual(is_happy(11), False) | |
def test_is_happy97(self): | |
self.assertEqual(is_happy(97), True) | |
def test_is_happy368(self): | |
self.assertEqual(is_happy(368), True) | |
def test_is_happy380(self): | |
self.assertEqual(is_happy(380), False) | |
def test_happy_primes_63(self): | |
self.assertEqual(happy_primes(range(63,100)), [79,97]) | |
def test_happy_primes_135(self): | |
self.assertEqual(happy_primes(range(135, 250)), [139, 167, 193, 239]) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment