def test_float(self): with self.assertRaises(Exception): prime3.is_prime(13.7)
def test_a_prime(self): self.assertTrue(prime3.is_prime(541))
def test_a_composite(self): self.assertFalse(prime3.is_prime(541*547))
def test_policy_1(self): prime3.index_policy = 1 prime3.largest_under(10) prime3.get_ordinal(13) prime3.is_prime(17) self.assertEqual({2:1, 7:4, 13:6, 17:7}, prime3.ordinal_index)
def test_a_composite(self): self.assertFalse(prime3.is_prime(541 * 547))
def test_policy_1(self): prime3.index_policy = 1 prime3.largest_under(10) prime3.get_ordinal(13) prime3.is_prime(17) self.assertEqual({2: 1, 7: 4, 13: 6, 17: 7}, prime3.ordinal_index)