Add check prime challenge (#226)

This commit is contained in:
Donne Martin
2018-01-19 19:14:17 -08:00
committed by GitHub
parent da5491b8a3
commit b4a64f78dc
4 changed files with 395 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from nose.tools import assert_equal, assert_raises
class TestMath(object):
def test_check_prime(self):
math = Math()
assert_raises(TypeError, math.check_prime, None)
assert_raises(TypeError, math.check_prime, 98.6)
assert_equal(math.check_prime(0), False)
assert_equal(math.check_prime(1), False)
assert_equal(math.check_prime(97), True)
print('Success: test_check_prime')
def main():
test = TestMath()
test.test_check_prime()
if __name__ == '__main__':
main()