From de35bed79fb82f08dbd2126f37b6dcf6eda7943d Mon Sep 17 00:00:00 2001 From: Halil Kaya Date: Thu, 2 Feb 2017 11:58:32 +0300 Subject: [PATCH] tests_halilkaya.py added --- solutions/prime_number/tests_halilkaya.py | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 solutions/prime_number/tests_halilkaya.py diff --git a/solutions/prime_number/tests_halilkaya.py b/solutions/prime_number/tests_halilkaya.py new file mode 100644 index 0000000..2874073 --- /dev/null +++ b/solutions/prime_number/tests_halilkaya.py @@ -0,0 +1,27 @@ +import pytest +from prime import is_prime + + +def test_negative(): + assert is_prime(-2) == False + +def test_zero(): + assert is_prime(0) == False + +def test_less_than_two(): + assert is_prime(1) == False + +def test_min_prime(): + assert is_prime(2) == True + +def test_positive(): + assert is_prime(47) == True + +def test_string(): + with pytest.raises(TypeError): + is_prime('47') + +def test_float(): + with pytest.raises(TypeError): + is_prime(49.9) +