Created
January 6, 2021 09:36
-
-
Save PaburoTC/56b6e34297219f0e1096d8981fed761a 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 | |
from prime import is_prime | |
class Tests(unittest.TestCase): | |
def test_1(self): | |
"""Check that 1 is not prime.""" | |
self.assertFalse(is_prime(1)) | |
def test_2(self): | |
"""Check that 2 is prime.""" | |
self.assertTrue(is_prime(2)) | |
def test_8(self): | |
"""Check that 8 is not prime.""" | |
self.assertFalse(is_prime(8)) | |
def test_11(self): | |
"""Check that 11 is prime.""" | |
self.assertTrue(is_prime(11)) | |
def test_25(self): | |
"""Check that 25 is not prime.""" | |
self.assertFalse(is_prime(25)) | |
def test_28(self): | |
"""Check that 28 is not prime.""" | |
self.assertFalse(is_prime(28)) | |
if __name__ == "__main__": | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment