How to use the inflect.NumOutOfRangeError function in inflect

To help you get started, we’ve selected a few inflect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GeneralizedLearningUtilities / SuperGLU / python_module / SuperGLU / Services / TextProcessing / Tests / Inflect / test_pwd.py View on Github external
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
github jazzband / inflect / tests.py View on Github external
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
github jazzband / inflect / tests / test_pwd.py View on Github external
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
github jazzband / inflect / inflect.py View on Github external
def millfn(self, ind=0):
        if ind > len(mill) - 1:
            print3("number out of range")
            raise NumOutOfRangeError
        return mill[ind]