def test_negative(self): with self.assertRaises(Exception): prime3.factorize(-6)
def test_zero(self): with self.assertRaises(Exception): prime3.factorize(0)
def test_float(self): with self.assertRaises(Exception): prime3.factorize(13.7)
def test_prime(self): results = prime3.factorize(7) expected = {7:1} self.assertEqual(results, expected)
def test_one(self): results = prime3.factorize(1) expected = {} self.assertEqual(results, expected)
def test_small(self): results = prime3.factorize(56) expected = {2:3, 7:1} self.assertEqual(results, expected)
def test_large(self): results = prime3.factorize(295927) expected = {541:1, 547:1} self.assertEqual(results, expected)
def test_prime(self): results = prime3.factorize(7) expected = {7: 1} self.assertEqual(results, expected)
def test_large(self): results = prime3.factorize(295927) expected = {541: 1, 547: 1} self.assertEqual(results, expected)
def test_small(self): results = prime3.factorize(56) expected = {2: 3, 7: 1} self.assertEqual(results, expected)