Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_millfn(self):
p = inflect.engine()
millfn = p.millfn
self.assertEqual(millfn(1), ' thousand')
self.assertEqual(millfn(2), ' million')
self.assertEqual(millfn(3), ' billion')
self.assertEqual(millfn(0), ' ')
self.assertEqual(millfn(11), ' decillion')
inflect.STDOUT_ON = False
self.assertRaises(NumOutOfRangeError, millfn, 12)
inflect.STDOUT_ON = True
def test_millfn(self):
p = inflect.engine()
millfn = p.millfn
self.assertEqual(millfn(1), ' thousand')
self.assertEqual(millfn(2), ' million')
self.assertEqual(millfn(3), ' billion')
self.assertEqual(millfn(0), '')
self.assertEqual(millfn(11), ' decillion')
inflect.STDOUT_ON = False
self.assertRaises(NumOutOfRangeError, millfn, 12)
inflect.STDOUT_ON = True
def test_millfn(self):
p = inflect.engine()
millfn = p.millfn
self.assertEqual(millfn(1), " thousand")
self.assertEqual(millfn(2), " million")
self.assertEqual(millfn(3), " billion")
self.assertEqual(millfn(0), " ")
self.assertEqual(millfn(11), " decillion")
inflect.STDOUT_ON = False
self.assertRaises(NumOutOfRangeError, millfn, 12)
inflect.STDOUT_ON = True
def millfn(self, ind=0):
if ind > len(mill) - 1:
print3("number out of range")
raise NumOutOfRangeError
return mill[ind]